Dynamic address translation with fetch protection in an emulated environment

ABSTRACT

What is provided is an enhanced dynamic address translation facility. In one embodiment, a virtual address to be translated is first obtained and an initial origin address of a translation table of the hierarchy of translation tables is obtained. Based on the obtained initial origin, a segment table entry is obtained. The segment table entry is configured to contain a format control and access validity fields. If the format control and access validity fields are enabled, the segment table entry further contains an access control field, a fetch protection field, and a segment-frame absolute address. Store operations are permitted only if the access control field matches a program access key provided by any one of a Program Status Word or an operand of a program instruction being emulated. Fetch operations are permitted if the program access key associated with the virtual address is equal to the segment access control field or the fetch protection field is not enabled.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is continuation of and claims priority from U.S. patentapplication Ser. No. 11/972,688 filed on Jan. 11, 2008, now U.S. Pat.No. 8,677,098; the entire disclosure is herein incorporated by referencein its entirety.

FIELD OF THE INVENTION

The present invention relates generally to systems and methods fortranslating a virtual address in a computer system and, moreparticularly, to systems and methods of translating a virtual addressinto a real or absolute address of a block of data in a computer systemhaving a dynamic address translation facility wherein virtual addresstranslation occurs via a hierarchy of translation tables.

BACKGROUND OF THE INVENTION

Dynamic Address Translation provides the ability to interrupt theexecution of a program at an arbitrary moment, record it and its data inauxiliary storage, such as a direct access storage device, and at alater time return the program and the data to different main storagelocations for resumption of execution. The transfer of the program andits data between main and auxiliary storage may be performed piecemeal,and the return of the information to main storage may take place inresponse to an attempt by the CPU to access it at the time it is neededfor execution. These functions may be performed without change orinspection of the program and its data, do not require any explicitprogramming convention in the relocated program, and do not disturb theexecution of the program except for the time delay involved.

With appropriate support by an operating system, the dynamic addresstranslation facility may be used to provide to a user a system whereinstorage appears to be larger than the main storage which is available inthe configuration. This apparent main storage is often referred to asvirtual storage, and the addresses used to designate locations in thevirtual storage are often referred to as virtual addresses. The virtualstorage of a user may far exceed the size of the main storage which isavailable in the configuration and normally is maintained in auxiliarystorage. The virtual storage is considered to be composed of blocks ofdata, commonly called pages (also referred to as segments and regions).Only the most recently referred to pages of the virtual storage areassigned to occupy blocks of physical main storage. As the user refersto pages of virtual storage that do not appear in main storage, they arebrought in to replace pages in main storage that are less likely to beneeded. In some cases, virtual storage is assigned to main storage for along period of time (or permanently), regardless of whether the storageis referenced. The swapping of pages of storage may be performed by theoperating system without the user's knowledge.

Programs use addresses (or virtual addresses) to access virtual storage.The program may fetch instructions from virtual storage or load data orstore data from virtual storage using virtual addresses. The virtualaddresses associated with a range of virtual storage define an addressspace. With appropriate support by an operating system, the dynamicaddress translation facility may be used to provide a number of addressspaces. These address spaces may be used to provide degrees of isolationbetween users. Such support can consist of completely different addressspace for each user, thus providing complete isolation, or a shared areamay be provided by mapping a portion of each address space to a singlecommon storage area. Also, instructions are provided which permit asemi-privileged program to access more than one such address space.

Dynamic address translation provides for the translation of virtualaddresses from multiple different address spaces. These address spacesare called primary address space, secondary address space, and AccessRegister specified address spaces. A privileged program can also causethe home address space to be accessed. Dynamic address translation maybe specified for instruction and data addresses generated by the CPU.

What is needed is an enhanced dynamic address translation facility whichprovides additional functionality, capability, and protectionsheretofore unknown to this art.

SUMMARY OF THE INVENTION

What is provided are a system, method, and computer program product foran enhanced dynamic address translation facility which translates avirtual address into a real or absolute address of a desired block ofdata in main storage of a computer system having a machine architecturewith a hierarchy of translation tables used for translation. Realaddresses may be subject to prefixing to form an absolute address.

In one example embodiment, a virtual address to be translated and aninitial origin address of a translation table of the hierarchy oftranslation tables are obtained. The translation table consists of aregion first table, a region second table, a region third table, or asegment table. Based on the obtained initial origin address, a segmenttable entry is obtained from the segment table. The segment table entryis configured to contain a format control field. If an enhanced DATfacility and the format control field are enabled, determining whetheran access validity field in the segment table entry is enabled. If theaccess validity field is enabled, the segment table entry furthercontains an access control field, a protection field, and asegment-frame absolute address of a large block of data in main storage.The large block of data is a block of at least 1 Megabyte in size. Ifthe access control field is enabled, store operations to the desiredblock of data are permitted only if the access control field matches aprogram access key provided by either a Program Status Word or anoperand of a program instruction being executed. Fetch operations fromthe desired block of data are permitted only if the program access keyassociated with the virtual address is equal to the access controlfield.

In yet another embodiment, if the access validity field is enabled, aprotection exception is indicated in response to a fetch operation or astore operation being attempted at the desired block of memory and thesegment access control field not matching the program access controlfield.

The invention will next be described in connection with certainillustrated embodiments. It should be understood that various changesand modifications can be made by those skilled in the art withoutdeparting from the spirit or scope of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying figures where like reference numerals refer toidentical or functionally similar elements throughout the separate viewsand which together with the detailed description below are incorporatedin and form part of the specification, serve to further illustratevarious embodiments and to explain various principles and advantages allin accordance with the present invention.

FIG. 1 illustrates one embodiment of a host computer system whereinenhanced dynamic address translation will be performed;

FIG. 2 provides an example emulated host computer system that emulatesthe host computer system of a host architecture;

FIG. 3 illustrates one embodiment of how the program status word is usedto determine the effective ASCE for dynamic address translation of thevirtual address;

FIG. 4 illustrates one embodiment wherein the effective ASCE determinedin FIG. 3 is used to determine the highest translation table in thehierarchy of translation tables used in translation of the virtualaddress;

FIG. 5A illustrates one embodiment of the process of dynamic addresstranslation of a virtual address using a hierarchy of translation tablesto the segment table level;

FIG. 5B illustrates a continuation of the dynamic address translation ofFIG. 5A wherein the Segment Table Entry (STE) format control (FC) iszero;

FIG. 5C illustrates a continuation of the dynamic address translation ofFIG. 5A wherein the Segment Table Entry (STE) format control (FC) isone;

FIG. 6 illustrates a flow diagram of one embodiment of enhanced dynamicaddress translation (eDAT) to obtain a format control field in a segmenttable entry;

FIG. 7 illustrates a continuation of the flow diagram from node 614 ofFIG. 6;

FIG. 8 illustrates a continuation of the flow diagram from node 616 ofFIG. 6;

FIG. 9 illustrates a flow diagram of one embodiment of determining thelevel of DAT protection to be applied to a desired block of dataaddressed by the translated virtual address;

FIG. 10 illustrates a continuation of the flow diagram from node 822 ofFIG. 8 determining the level of access control protection to be appliedto a desired block of data addressed by the translated virtual address;

FIG. 11 illustrates a continuation of the flow diagram from node 822 ofFIG. 8 determining the level of fetch protection to be applied to adesired block of data addressed by the translated virtual address;

FIG. 12 illustrates a continuation of the flow diagram from node 822 ofFIG. 8 wherein a change recording override field is obtained from asegment table entry; and

FIG. 13 illustrates the relationship between real and absoluteaddresses.

DETAILED DESCRIPTION

It should be understood that statements made in the specification of thepresent application do not necessarily limit any of the various claimedinventions. Moreover, some statements may apply to some inventivefeatures but not to others. Unless otherwise indicated, singularelements may be in the plural and vice versa with no loss of generality.

One of ordinary skill in this art would be readily familiar withaddressing storage in a computing environment and using bits in aregister or address field to indicate differing states and acting onthose states. Further, one of average skill in this art would beknowledgeable in the art of computer program and knowledgeable about theworkings and interrelationships between components of computer systems.

OVERVIEW

What is provided is an example embodiment of an enhanced Dynamic AddressTranslation (DAT) facility. When the enhanced DAT facility is installedand enabled, DAT translation may produce either a page frame realaddress or a segment frame absolute address, determined by the SegmentTable Entry (STE) format control in the segment table entry. As usedherein, the term “enhanced DAT applies” means all of the following aretrue: 1) The EDAT facility is installed; 2) The EDAT facility is enabledvia control register 0 (CR0) bit 40; and, 3) The address is translatedby means of DAT-table entries.

When enhanced DAT applies, the following additional function isavailable in the DAT process:

-   -   A DAT protection bit is added to region table entries, providing        function similar to the DAT protection bits in the segment and        page table entries.    -   A STE format control is added to the segment table entry. When        the STE format control is zero, DAT proceeds as is currently        defined, except that a change recording override in the page        table entry indicates whether setting of the change bit may be        bypassed for the page.    -   When the STE format control is one, the segment table entry also        contains the following:        -   A segment frame absolute address (rather than a page table            origin) specifying the absolute storage location of the 1            Megabyte block.        -   Access control bits and a fetch protection bit which            optionally may be used in lieu of the corresponding bits in            the segment's individual storage keys.        -   A bit which determines the validity of the access control            bits and a fetch protection bit in the segment table entry.        -   A change recording override which indicates whether setting            of the change bit may be bypassed in the segment's            individual storage keys.            Host Computer System

Referring to FIG. 1, representative components of a host computer system100 are portrayed. Other arrangements of components may also be employedin a computer system which is well known in the art.

The host computing environment is preferably based on thez/Architecture® offered by International Business Machines Corporation(IBM®), Armonk, N.Y. The z/Architecture® is more fully described in:z/Architecture® Principles of Operation, IBM® Pub. No. SA22-7832-05,6^(th) Edition, (April 2007), which is incorporated by reference hereinin its entirety. Computing environments based on the z/Architecture®include, for example, eServer and zSeries®, both by IBM®.

The representative host computer 100 comprises one or more CPUs 101 incommunication with main store (computer memory 102) as well as I/Ointerfaces to storage devices 111 and networks 110 for communicatingwith other computers or storage area networks (SANs) and the like. TheCPU may have Dynamic Address Translation (DAT) facility (function orunit) 103 for transforming program addresses (virtual addresses) intoreal address of memory. A DAT facility typically includes a translationlookaside buffer 107 for caching translations so that later accesses tothe block of computer memory 102 do not require the delay of addresstranslation. Typically a cache 109 is employed between computer memory102 and the Processor 101. The cache 109 may be hierarchical having alarge cache available to more than one CPU and smaller, faster (lowerlevel) caches between the large cache and each CPU. In someimplementations the lower level caches are split to provide separate lowlevel caches for instruction fetching and data accesses. In anembodiment, an instruction is fetched from memory 102 by an instructionfetch unit 104 via a cache 109. The instruction is decoded in aninstruction decode unit (106) and dispatched (with other instructions insome embodiments) to instruction execution units 108. Typically severalexecution units 108 are employed, for example an arithmetic executionunit, a floating point execution unit and a branch instruction executionunit. The instruction is executed by the execution unit, accessingoperands from instruction specified registers or memory as needed. If anoperand is to be accessed (loaded or stored) from memory 102, a loadstore unit 105 typically handles the access under control of theinstruction being executed.

In an embodiment, the invention may be practiced by software (sometimesreferred to Licensed Internal Code (LIC), firmware, micro-code,milli-code, pico-code and the like, any of which would be consistentwith the present invention). Software program code which embodies thepresent invention is typically accessed by the processor also known as aCPU (Central Processing Unit) 101 of computer system 100 from long termstorage media 111, such as a CD-ROM drive, tape drive or hard drive. Thesoftware program code may be embodied on any of a variety of known mediafor use with a data processing system, such as a diskette, hard drive,or CD-ROM. The code may be distributed on such media, or may bedistributed to users from the computer memory 102 or storage of onecomputer system over a network 110 to other computer systems for use byusers of such other systems.

Alternatively, the program code may be embodied in the memory 102, andaccessed by the processor 101 using the processor bus. Such program codeincludes an operating system which controls the function and interactionof the various computer components and one or more application programs.Program code is normally paged from dense storage media 111 to highspeed memory 102 where it is available for processing by the processor101. The techniques and methods for embodying software program code inmemory, on physical media, and/or distributing software code vianetworks are well known and will not be further discussed herein.Program code, when created and stored on a tangible medium (includingbut not limited to electronic memory modules (RAM), flash memory,compact discs (CDs), DVDs, magnetic tape and the like is often referredto as a “computer program product”. The computer program product mediumis typically readable by a processing circuit preferably in a computersystem for execution by the processing circuit.

In FIG. 2, an example emulated host computer system 201 is provided thatemulates a host computer system 100 of a host architecture. In theemulated host computer system 201, the host processor (CPUs) 208 is anemulated host processor (or virtual host processor) and comprises anemulation processor 207 having a different native instruction setarchitecture than that used by the processor 101 of the host computer100. The emulated host computer system 201 has memory 202 accessible tothe emulation processor 207. In the example embodiment, the memory 207is partitioned into a host computer memory 102 portion and an emulationroutines 203 portion (routines which provide the emulation may be partof the host memory). The host computer memory 102 is available toprograms of the emulated host computer 201 according to host computerarchitecture. The emulation processor 207 executes native instructionsof an architected instruction set of an architecture other than that ofthe emulated processor 208, the native instructions obtained fromemulation routines memory 203, and may access a host instruction forexecution from a program in host computer memory 102 by employing one ormore instruction(s) obtained in a Sequence & Access/Decode routine whichmay decode the host instruction(s) accessed to determine a nativeinstruction execution routine for emulating the function of the hostinstruction accessed.

Other facilities that are defined for the host computer system 100architecture may be emulated by Architected Facilities Routines,including such facilities as General Purpose Registers, ControlRegisters, Dynamic Address Translation, and I/O Subsystem support andprocessor cache for example. The emulation routines may also takeadvantage of function available in the emulation processor 207 (such asGeneral Registers and dynamic translation of virtual addresses) toimprove performance of the emulation routines. Special hardware and OffLoad Engines may also be provided to assist the processor 207 inemulating the function of the host computer 100.

Computer Processor and Registers

In an embodiment, a CPU's program instruction functionality communicateswith a plurality of registers over a communication bus. Thecommunication bus may be internal or external to the CPU. Some registersmay be read only. Other hardware and/or software may also read/write toone or more of the registers accessible by the CPU. An instructionoperation code (opcode) determines which type of register is to be usedin any particular machine instruction operation.

General Registers

Instructions may designate information in one or more of 16 generalregisters. The general registers may be used as base address registersand index registers in address arithmetic and as accumulators in generalarithmetic and logical operations. Each register contains 64 bitpositions. The general registers are identified by the numbers 0-15 andare designated by a four bit R field in an instruction. Someinstructions provide for addressing multiple general registers by havingseveral R fields. For some instructions, the use of a specific generalregister is implied rather than explicitly designated by an R field ofthe instruction.

For some operations, either bits 32-63 or bits 0-63 of two adjacentgeneral registers are coupled, providing a 64-bit or 128-bit format,respectively. In these operations, the program must designate an evennumbered register, which contains the leftmost (high order) 32 or 64bits. The next higher numbered register contains the rightmost (loworder) 32 or 64 bits. In addition to their use as accumulators ingeneral arithmetic and logical operations, 15 of the 16 generalregisters are also used as base address and index registers in addressgeneration. In these cases, the registers are designated by a four bit Bfield or X field in an instruction. A value of zero in the B or X fieldspecifies that no base or index is to be applied, and, thus, generalregister 0 cannot be designated as containing a base address or index.

Control Registers

The control registers provide for maintaining and manipulating controlinformation outside the program status word. The CPU has 16 controlregisters, each having 64 bit positions. The bit positions in theregisters are assigned to particular facilities in the system, such asprogram event recording, and are used either to specify that anoperation can take place or to furnish special information required bythe facility. The control registers are identified by the numbers 0-15and are designated by four bit R fields in the instructions LOAD CONTROLand STORE CONTROL. Multiple control registers can be addressed by theseinstructions.

Control Register 1

Control register 1 contains the Primary Address Space Control Element(PASCE). In one embodiment, control register 1 has one of the followingtwo formats, depending on the real space control bit (R) in theregister:

Selected fields in the Primary Address Space Control Element (PASCE) areallocated as follows:

Primary Region Table or Segment Table Origin:

Bits 0-51 of the primary region table or segment table designation incontrol register 1, with 12 zeros appended on the right, form a 64-bitaddress that designates the beginning of the primary region table orsegment table. It is unpredictable whether the address is real orabsolute. This table is called the primary region table or segment tablesince it is used to translate virtual addresses in the primary addressspace.

Primary Real Space Control (R):

If bit 58 of control register 1 is zero, the register contains a regiontable or segment table designation. If bit 58 is one, the registercontains a real space designation. When bit 58 is one, a one value ofthe common segment bit in a translation lookaside buffer representationof a segment table entry prevents the entry and the translationlookaside buffer page table copy it designates from being used whentranslating references to the primary address space, even with a matchbetween the token origin in control register 1 and the table origin inthe translation lookaside buffer entry.

Primary Designation Type Control (DT):

When R is zero, the type of table designation in control register 1 isspecified by bits 60 and 61 in the register, as follows:

Primary Designation Type (DT) control bits Bits 60 and 61 DesignationType 11 Region-first-table 10 Region-second-table 01 Region-third-table00 Segment-table

When R is zero, bits 60 and 61 must be 11 binary when an attempt is madeto use the PASCE to translate a virtual address in which the leftmostone bit is in bit positions 0-10 of the address. Similarly, bits 60 and61 must be 11 or 10 binary when the leftmost one bit is in bit positions11-21 of the address, and they must be 11, 10, or 01 binary when theleftmost one bit is in bit positions 22-32 of the address. Otherwise, anASCE-type exception is recognized.

Primary Region Table or Segment Table Length (TL):

Bits 62 and 63 of the primary region table designation or segment tabledesignation in control register 1 specify the length of the primaryregion table or segment table in units of 4,096 bytes, thus making thelength of the region table or segment table variable in multiples of 512entries. The length of the primary region table or segment table, inunits of 4,096 bytes, is one more than the TL value. The contents of thelength field are used to establish whether the portion of the virtualaddress (RFX, RSX, RTX, or SX) to be translated by means of the tabledesignates an entry that falls within the table.

Primary Real Space Token Origin:

Bits 0-51 of the primary real space designation in control register 1,with 12 zeros appended on the right, form a 64-bit address that may beused in forming and using translation lookaside buffer entries thatprovide a virtual equals real translation for references to the primaryaddress space. Although this address is used only as a token and is notused to perform a storage reference, it still must be a valid address;otherwise, an incorrect translation lookaside buffer entry may be usedwhen the contents of control register 1 are used.

The following bits of control register 1 are not assigned and areignored: bits 52, 53, and 59 if the register contains a region tabledesignation or segment table designation, and bits 52, 53 and 59-63 ifthe register contains a real space designation.

Control Register 7

Control register 7 contains the Secondary Address Space Control Element(SASCE). In one embodiment, control register 7 has one of the followingtwo formats, depending on the real space control bit (R) in theregister:

Control Register 13

Control register 13 contains the Home Address Space Control Element(HASCE). In one embodiment, control register 13 has one of the followingtwo formats, depending on the real space control bit (R) in theregister:

Access Registers

The CPU has 16 access registers numbered 0-15. An access registerconsists of 32 bit positions containing an indirect specification of anASCE. An ASCE is a parameter used by the dynamic address translation(DAT) mechanism to translate references to a corresponding addressspace. When the CPU is in a mode called the access register mode(controlled by bits in the program status word), an instruction B field,used to specify a logical address for a storage operand reference,designates an access register, and the ASCE specified by the accessregister is used by DAT for the reference being made. For someinstructions, an R field is used instead of a B field. Instructions areprovided for loading and storing the contents of the access registersand for moving the contents of one access register to another.

Each of access registers 1-15 can designate any address space, includingthe current instruction space (the primary address space). Accessregister 0 designates the primary instruction space. When one of accessregisters 1-15 is used to designate an address space, the CPU determineswhich address space is designated by translating the contents of theaccess register. When access register 0 is used to designate an addressspace, the CPU treats the access register as designating the primaryinstruction space, and it does not examine the actual contents of theaccess register. Therefore, the 16 access registers can designate, atany one time, the primary instruction space and a maximum of 15 otherspaces.

Program Status Word (PSW)

The program status word includes the instruction address, conditioncode, and other information used to control instruction sequencing andto determine the state of the CPU. The active or controlling programstatus word is called the current program status word. It governs theprogram currently being executed.

The CPU has an interruption capability, which permits the CPU to switchrapidly to another program in response to exceptional conditions andexternal stimuli. When an interruption occurs, the CPU places thecurrent program status word in an assigned storage location, called theold program status word location, for the particular class ofinterruption. The CPU fetches a new program status word from a secondassigned storage location. This new program status word determines thenext program to be executed. When it has finished processing theinterruption, the program handling the interruption may reload the oldprogram status word, making it again the current program status word, sothat the interrupted program can continue.

There are six classes of interruption: external, I/O, machine check,program, restart, and supervisor call. Each class has a distinct pair ofold program status word and new program status word locationspermanently assigned in real storage.

Current Program Status Word

The current program status word in the CPU contains information requiredfor the execution of the currently active program. The program statusword is 128 bits in length and includes the instruction address,condition code, and other control fields. In general, the program statusword is used to control instruction sequencing and to hold and indicatemuch of the status of the CPU in relation to the program currently beingexecuted. Additional control and status information is contained incontrol registers and permanently assigned storage locations. The statusof the CPU can be changed by loading a new program status word or partof a program status word.

Control is switched during an interruption of the CPU by storing thecurrent program status word, so as to preserve the status of the CPU,and then loading a new program status word. Execution of LOAD PSW orLOAD PSW EXTENDED, or the successful conclusion of the initial programloading sequence, introduces a new program status word. The instructionaddress is updated by sequential instruction execution and replaced bysuccessful branches. Other instructions are provided which operate on aportion of the program status word.

A new or modified program status word becomes active (that is, theinformation introduced into the current program status word assumescontrol over the CPU) when the interruption or the execution of aninstruction that changes the program status word is completed. Theinterruption for Program Event Recording (PER) associated with aninstruction that changes the program status word occurs under control ofthe PER mask that is effective at the beginning of the operation. Bits0-7 of the program status word are collectively referred to as thesystem mask. In one embodiment, the program status word has thefollowing format:

The following is a brief summary of the functions of selected programstatus word fields.

DAT Mode (T):

Bit 5 controls whether implicit dynamic address translation of logicaland instruction addresses used to access storage takes place. When bit 5is zero, DAT is off and logical and instruction addresses are treated asreal addresses. When bit 5 is one, DAT is on, and the dynamic addresstranslation mechanism is invoked.

PSW Key:

Bits 8-11 form the access key for storage references by the CPU. If thereference is subject to key controlled protection, the PSW Key ismatched with a storage key when information is stored or wheninformation is fetched from a location that is protected againstfetching. However, for one of the operands of each of MOVE TO PRIMARY,MOVE TO SECONDARY, MOVE WITH KEY, MOVE WITH SOURCE KEY, and MOVE WITHDESTINATION KEY, an access key specified as an operand is used insteadof the PSW Key.

Address Space Control (AS):

Bits 16 and 17, in conjunction with Program Status Word bit 5, controlthe translation mode.

Condition Code (CC):

Bits 18 and 19 are the two bits of the condition code. The conditioncode is set to 0, 1, 2, or 3, depending on the result obtained inexecuting certain instructions. Most arithmetic and logical operations,as well as some other operations, set the condition code. Theinstruction BRANCH ON CONDITION can specify any selection of thecondition code values as a criterion for branching.

Instruction Address:

Bits 64-127 of the program status word are the instruction address. Thisaddress designates the location of the leftmost byte of the nextinstruction to be executed, unless the CPU is in the wait state (bit 14of the program status word is one).

Address Types & Formats

For purposes of addressing main storage, three basic types of addressesare recognized: absolute, real, and virtual. The addresses aredistinguished on the basis of the transformations that are applied tothe address during a storage access. Address translation converts avirtual address to a real address. Prefixing converts a real address toan absolute address. In addition to the three basic address types,additional types are defined which are treated as one or another of thethree basic types, depending on the instruction and the current mode.

Absolute Address

An absolute address is the address assigned to a main storage location.An absolute address is used for a storage access without anytransformations performed on it. The channel subsystem and all CPUs inthe configuration refer to a shared main storage location by using thesame absolute address. Available main storage is usually assignedcontiguous absolute addresses starting at 0, and the addresses areassigned in complete 4 Kilobyte blocks on integral boundaries. Anexception is recognized when an attempt is made to use an absoluteaddress in a block which has not been assigned to physical locations. Onsome models, storage reconfiguration controls may be provided whichpermit the operator to change the correspondence between absoluteaddresses and physical locations. However, at any one time, a physicallocation is not associated with more than one absolute address. Storageconsisting of byte locations sequenced according to their absoluteaddresses is referred to as absolute storage.

Real Address

A real address identifies a location in real storage. When a realaddress is used for an access to main storage, it is converted, by meansof prefixing, to form an absolute address. At any instant there is onereal address to absolute address mapping for each CPU in theconfiguration. When a real address is used by a CPU to access mainstorage, it may be converted to an absolute address by prefixing. Theparticular transformation is defined by the value in the prefix registerfor the CPU. Storage consisting of byte locations sequenced according totheir real addresses is referred to as real storage.

Virtual Address

A virtual address identifies a location in virtual storage. When avirtual address is used for an access to main storage, it is translatedby means of dynamic address translation, either to a real address whichmay be subject to prefixing to form an absolute address, or directly toan absolute address.

Primary Virtual Address

A primary virtual address is a virtual address which is to be translatedby means of the Primary Address Space Control Element (PASCE). Logicaladdresses are treated as primary virtual addresses when in the primaryspace mode. Instruction addresses are treated as primary virtualaddresses when in the primary space mode, secondary space mode, oraccess register mode. The first operand address of MOVE TO PRIMARY andthe second operand address of MOVE TO SECONDARY are treated as primaryvirtual addresses.

Secondary Virtual Address

A secondary virtual address is a virtual address which is to betranslated by means of the Secondary Address Space Control Element(SASCE). Logical addresses are treated as secondary virtual addresseswhen in the secondary space mode. The second operand address of MOVE TOPRIMARY and the first operand address of MOVE TO SECONDARY are treatedas secondary virtual addresses.

AR Specified Virtual Address

An AR specified virtual address is a virtual address which is to betranslated by means of an Access Register-specified Address SpaceControl Element. Logical addresses are treated as AR specified addresseswhen in the access register mode.

Home Virtual Address

A home virtual address is a virtual address which is to be translated bymeans of the Home Address Space Control Element (HASCE). Logicaladdresses and instruction addresses are treated as home virtualaddresses when in the home space mode.

Instruction Address

Addresses used to fetch instructions from storage are called instructionaddresses. Instruction addresses are treated as real addresses in thereal mode, as primary virtual addresses in the primary space mode,secondary space mode, or access register mode, and as home virtualaddresses in the home space mode. The instruction address in the currentprogram status word and the target address of EXECUTE are instructionaddresses.

Effective Address

In some situations, it is convenient to use the term “effectiveaddress.” An effective address is the address which exists before anytransformation by dynamic address translation or prefixing is performed.An effective address may be specified directly in a register or mayresult from address arithmetic. Address arithmetic is the addition ofthe base and displacement or of the base, index, and displacement.

Prefixing

Prefixing provides the ability to assign the range of real addresses0-8191 to a different block in absolute storage for each CPU, thuspermitting more than one CPU sharing main storage to operateconcurrently with a minimum of interference, especially in theprocessing of interruptions. Prefixing causes real addresses in therange 0-8191 to correspond one-for-one to the block of 8K byte absoluteaddresses (the prefix area) identified by the value in bit positions0-50 of the prefix register for the CPU, and the block of real addressesidentified by that value in the prefix register to correspondone-for-one to absolute addresses 0-8191. The remaining real addressesare the same as the corresponding absolute addresses. Thistransformation allows each CPU to access all of main storage, includingthe first 8K bytes and the locations designated by the prefix registersof other CPUs.

The prefix is a 51-bit quantity contained in bit positions 0-50 of theprefix register. In one embodiment, the prefix register has thefollowing format:

When prefixing is applied, the real address is transformed into anabsolute address by using one of the following rules, depending on bits0-50 of the real address:

-   -   1. Bits 0-50 of the address, if all zeros, are replaced with        bits 0-50 of the prefix.    -   2. Bits 0-50 of the address, if equal to bits 0-50 of the        prefix, are replaced with zeros.    -   3. Bits 0-50 of the address, if not all zeros and not equal to        bits 0-50 of the prefix, remain unchanged.

Only the address presented to storage is translated by prefixing. Thecontents of the source of the address remain unchanged.

The distinction between real and absolute addresses is made even whenthe prefix register contains all zeros, in which case a real address andits corresponding absolute address are identical. FIG. 13 illustratesthe relationship between real and absolute addresses.

An address space is a consecutive sequence of integer numbers (virtualaddresses); together with the specific transformation parameters whichallow each number to be associated with a byte location in storage. Thesequence starts at zero and proceeds left to right.

When a virtual address is used by a CPU to access main storage, it isfirst converted, by means of dynamic address translation (DAT), to areal or absolute address. Real addresses may be further subjected toprefixing to form an absolute address. DAT may use a region first table,region second table, region third table, segment table, and a page tableas transformation parameters. The designation (origin and length) of thehighest level table for a specific address space is called an AddressSpace Control Element (ASCE), and it is found for use by DAT in acontrol register or as specified by an access register. Alternatively,the ASCE for an address space may be a real space designation, whichindicates that DAT is to translate the virtual address simply bytreating it as a real address and without using any tables.

DAT uses, at different times, the ASCE in different control registers orspecified by the access registers. The choice is determined by thetranslation mode specified in the current program status word. Fourtranslation modes are available: primary space mode, secondary spacemode, access register mode, and home space mode. Different addressspaces are addressable depending on the translation mode.

At any instant when the CPU is in the primary space mode or secondaryspace mode, the CPU can translate virtual addresses belonging to twoaddress spaces—the primary address space and the secondary addressspace. At any instant when the CPU is in the access register mode, itcan translate virtual addresses of up to 16 address spaces—the primaryaddress space and up to 15 AR specified address spaces. At any instantwhen the CPU is in the home space mode, it can translate virtualaddresses of the home address space.

The primary address space is identified as such because it consists ofprimary virtual addresses, which are translated by means of the PrimaryAddress Space Control Element (PASCE). Similarly, the secondary addressspace consists of secondary virtual addresses translated by means of theSecondary Address Space Control Element (SASCE). The AR specifiedaddress spaces consist of AR specified virtual addresses translated bymeans of Access Register-specified Address Space Control Element (ARspecified ASCE), and the home address space consists of home virtualaddresses translated by means of the Home Address Space Control Element(HASCE). The primary and secondary ASCEs are in control registers 1 and7, respectively. The AR specified ASCEs may be in control registers 1and 7, or in table entries called ASN second table entries. The HASCE isin control register 13.

Dynamic Address Translation

Dynamic address translation is the process of translating a virtualaddress (during a storage reference, for example) into the correspondingmain memory address (real address or absolute address in theembodiment). The virtual address may be a primary virtual address,secondary virtual address, Access Register specified virtual address, ora home virtual address. These addresses are translated by means of thePASCE, SASCE, AR-specified ASCE, or the HASCE, respectively. Afterselection of the appropriate ASCE, the translation process is the samefor all of the four types of virtual address.

Addressing Translation Mode

An effective address is the address (virtual address) which existsbefore any transformation by dynamic address translation or prefixing isperformed. The three bits in the program status word that controldynamic address translation are bit 5, the DAT mode bit, and bits 16 and17, the address space control bits. When the DAT mode bit is zero, thenDAT is off, and the CPU is in the real mode. When the DAT mode bit isone, then DAT is on, and the CPU is in the translation mode designatedby the address space control bits: binary 00 designates the primaryspace mode, binary 01 designates the access register mode, binary 10designates the secondary space mode, and binary 11 designates the homespace mode. The various modes are shown below, along with the handlingof addresses in each mode.

Translation Modes Handling of Addresses PSW Bit Instruction Logical 5 1617 DAT Mode Addresses Addresses 0 0 0 Off Real mode Real Real 0 0 1 OffReal mode Real Real 0 1 0 Off Real mode Real Real 0 1 1 Off Real modeReal Real 1 0 0 On Primary-space mode Primary virtual Primary virtual 10 1 On Access-register Primary virtual AR-specified mode virtual 1 1 0On Secondary-space Primary virtual Secondary mode virtual 1 1 1 OnHome-space mode Home virtual Home virtual

The Program Status Word is a 128 bit word which, in part, provides 2bits which indicate the addressing mode. In one embodiment, bit 31 isthe Extended Addressing Mode (EA) bit and bit 32 is the Base AddressingMode (BA) bit. These two bits indicate the size of addresses. The stateof each of these two bits is binary (1 or 0). If the EA bit is 0 and theBA bit is 0 then 24-bit addressing is indicated. If 24-bit addressing isindicated, bits 40-63 of a 64-bit word (a 64-bit entity is commonlycalled a doubleword) is where the address is located. Where theinstruction address occupies the second 64 bits of a 128-bit entity (aquadword), the bit positions in the program status word are as follows.In 24-bit mode, the instruction address is in bits 104-127 of theprogram status word. In the 31-bit mode, the instruction address is inbits 97-127 of the program status word. In 64-bit mode, the instructionaddress is in bits 64-127 of the program status word. If the EA bit is 0and the BA bit is 1 then 31-bit addressing is indicated. The appropriate64-bit word contains a 31-bit address located at bit positions 33-63. Ifthe EA bit is 1 and the BA bit is 1 then bits 0-63, which is the entire64-bits, of a 64-bit word contains the address. Otherwise, an exceptioncondition is indicated. Once the addressing mode has been obtained, theASCE needs to be determined.

Address Space Control Element (ASCE)

Reference is now being made to FIG. 3 which illustrates one embodimentof how the Program Status Word is used to determine the effectiveAddress Space Control Element (ASCE) for dynamic address translation ofthe virtual address. The ASCE may specify, for example, a 2 Gigabytes(Giga=) 2³° address space. Or, it may specify, for example, 4 Terabytes(Tera=2⁴⁰), 8 Petabytes (Peta=2⁵⁰), or a 16 Exabytes (Exa=2⁶⁰) addressspace. Or, it may specify a real-space designation. A real spacedesignation causes the virtual address to be treated as a real addressin storage without referencing one or more address translation tables.

The Program Status Word 300 contains a translation (T) bit 302 andAddress Space (AS) bits 304. At 306, if the translation (T) bit is zerothen the address is a real address 326. If, at 308, the Address Space(AS) equals zero (binary 00) then the effective ASCE for this virtualaddress is the Primary Address Space Control Element (PASCE) 310. If, at312, the Address Space (AS) equals one (binary 01) then the effectiveASCE is the Access Register-specified Address Space Control Element 314.If, at 316, an Address Space (AS) equals two (binary 10) then theeffective ASCE is the Secondary Address Space Control Element (SASCE)318. Otherwise, the Address Space (AS) equals three (binary 11) and theeffective ASCE is the Home Address Space Control Element (HASCE) 322.

After selection of the effective ASCE, the process of dynamic addresstranslation is preferably the same for all four types of virtualaddresses.

A segment table designation or region table designation causestranslation to be performed by means of tables established by theoperating system in real or absolute storage. A real space designationcauses the virtual address simply to be treated as a real address,without the use of tables in storage.

In the process of translation when using a segment table designation ora region table designation, three types of units of information arerecognized—regions, segments, and pages. A region is a block ofsequential virtual addresses spanning 2 Gigabytes and beginning at a 2Gigabyte boundary. A segment is a block of sequential virtual addressesspanning 1 Megabytes and beginning at a 1 Megabyte boundary. A page is ablock of sequential virtual addresses spanning 4 Kilobytes and beginningat a 4 Kilobyte boundary.

Virtual Address Format

Translation of a virtual address may involve referencing a plurality oftranslation tables of a hierarchy of translation tables to obtain a realor absolute address. The real address may be further subject to aprefixing operation to form an absolute address. The virtual addresscontains indexes to entries in translation tables in the hierarchy oftranslation tables. The virtual address, accordingly, is divided intofour principal fields. Bits 0-32 are called the region index (RX), bits33-43 are called the segment index (SX), bits 44-51 are called the pageindex (PX), and bits 52-63 are called the byte index (BX). In oneembodiment, the virtual address has the following format:

As determined by its ASCE, a virtual address space may be a 2 Gigabytespace consisting of one region, or it may be up to a 16 Exabyte spaceconsisting of up to 8 Gigabyte regions. The RX part of a virtual addressapplying to a 2 Gigabyte address space must be all zeros; otherwise, anexception is recognized. The RX part of a virtual address is itselfdivided into three fields. Bits 0-10 are called the region first index(RFX), bits 11-21 are called the region second index (RSX), and bits22-32 are called the region third index (RTX). In one embodiment, bits0-32 of the virtual address have the following format:

A virtual address in which the RTX is the leftmost significant part (a42-bit address) is capable of addressing 4 Terabytes (2048 regions), onein which the RSX is the leftmost significant part (a 53-bit address) iscapable of addressing 8 Petabytes (4,193,044 regions), and one in whichthe RFX is the leftmost significant part (a 64-bit address) is capableof addressing 16 Exabytes (8,589,934,592 regions).

A virtual address in which the RX is zero can be translated into realaddresses by means of two translation tables: a segment table and a pagetable. With the EDAT facility enabled, the translation may be completedwith only the segment table. The RFX may be non-zero, in which case aregion first table, region second table, and region third table, arerequired. If the RFX is zero, but the RSX may be non-zero, a regionsecond table and region third table are required. If the RFX and RSX arezero, but the RTX may be non-zero, a region third table is required.

An exception is recognized if the ASCE for an address space does notdesignate the highest level of table (beginning with the region firsttable and continuing downward to the segment table) needed to translatea reference to the address space

Dynamic Translation of the Virtual Address

Reference is now being made to FIG. 4 illustrating one embodimentwherein the effective ASCE determined in FIG. 3 is used to determine thefirst translation table in the hierarchy of translation tables used intranslation of the virtual address.

In one embodiment, control register 1 (CR1) contains the PASCE. Controlregister 7 (CR7) contains the SASCE. Control register 13 (CR13) containsthe HASCE, and an Address-Space-Second-table Entry (ASTE) that isderived by the Access-Register-Translation (ART) process contains anAccess Register-specified Address Space Control Element. An effectiveASCE 400 is selected from one of these locations.

A first portion of the effective ASCE 400 contains a table origin 402which contains an origin address designating either a region firsttable, a region second table, a region third table, or a segment table.The table origin (bits 0 . . . 51) is appended with 12 binary zeros toform a 64-bit origin address of the highest translation table in thehierarchy of translation tables to be used in translation of the virtualaddress. Effective ASCE 400 also contains a real space control (R) bit404 and DT bits 406. If the real space control (R) bit is zero then theDT bits are decoded by selector 408 to determine which particular originaddress is table origin 402. If the DT bits equal three (binary 11) thentable origin 402 designates a region first table 410. If the DT bitsequal two (binary 10) then table origin 402 designates a region secondtable 412. If the DT bits equal one (binary 01) then table origin 402designates a region third table 414. Otherwise, if the DT bits equalzero (binary 00) then table origin 402 designates a segment table 416.

A region first table, region second table, or region third table issometimes referred to simply as a region table. Similarly, a regionfirst table designation, region second table designation, or regionthird table designation is sometimes referred to as a region tabledesignation. The region, segment, and page tables reflect the currentassignment of real storage. Page is a term used for the assignment ofvirtual storage. Real storage is allotted in fixed blocks. Pages neednot be adjacent in real storage even though assigned to a set ofsequential virtual addresses.

When the ASCE used in a translation is a region first table designation,the translation process consists in a multi-level lookup using, forexample, a region first table, a region second table, a region thirdtable, a segment table, and optionally a page table. These tables residein real or absolute storage. When the ASCE is a region second tabledesignation, region third table designation, or segment tabledesignation, the lookups in the levels of tables above the designatedlevel are omitted, and the higher level tables themselves are omitted.

Reference is now being made to FIG. 5A illustrating one embodiment ofdynamic address translation of a virtual address using a hierarchy oftranslation tables.

The effective ASCE 400 of FIG. 4 contains the Designation Type (DT) bits406. If the real space control (R) 404 bit of the ASCE is zero then theDT bits are decoded by selector 408 to determine which origin addresstable origin 402 designates. If the real space control (R) bit is onethen dynamic address translation takes place as shown at node D 564 inFIG. 5B.

If the DT bits equal three (binary 11) in selector 408 then thedesignated first table in the hierarchy of translation tables is aregion first table. Table origin 402 is arithmetically added, at 502,with a Region First Index (RFX) 508 portion of the virtual address toreference region first table entry 506 in a region first table. Thetable origin (either with 12 zeros appended on the right, or multipliedby 4096) is added to the product of the index multiplied by 8 (or theindex with three zeros appended on the right). The region first tableentry contains a region second table origin 504 to a next lower table inthe hierarchy of translation tables used in translation. The next lowertable to the region first table is the region second table. If theinvalid (I) bit of the region first table entry is equal to one then theregion first table entry is invalid and cannot be used in translation.An exception condition is indicated.

If the DT bits equal two (binary 10) in selector 408 then the designatedfirst table in the hierarchy of translation tables is a region secondtable. Table origin 402 is arithmetically added, at 510, with a RegionSecond Index (RSX) 516 portion of the virtual address to referenceregion second table entry 514 in a region second table. The table origin(either with 12 zeros appended on the right, or multiplied by 4096) isadded to the product of the index multiplied by 8 (or the index withthree zeros appended on the right). The region second table entrycontains a region third table origin 512 to a next lower table in thehierarchy of translation tables used in translation. The next lowertable to the region second table is the region third table. If theinvalid (I) bit of the region second table entry is equal to one thenthe region second table entry is invalid and an exception condition isindicated.

If the DT bits equal one (binary (01) in selector 408 then thedesignated first table in the hierarchy of translation tables is aregion third table. Table origin 402 is arithmetically added, at 518,with a Region Third Index (RTX) 524 portion of the virtual address toreference region third table entry 522 in a region third table. Thetable origin (either with 12 zeros appended on the right, or multipliedby 4096) is added to the product of the index multiplied by 8 (or theindex with three zeros appended on the right). The region third tableentry contains a segment table origin 520 to a next lower table in thehierarchy of translation tables used in translation. The next lowertable to the region third table is the segment table. If the invalid (I)bit of the region third table entry is equal to one then the regionthird table entry is invalid and an exception condition is indicated.

If the DT bits equal zero (binary (00) in selector 408 then thedesignated first table in the hierarchy of translation tables is asegment table. Table origin 402 is arithmetically added, at 526, with aSegment Index (SX) 532 portion of the virtual address to referencesegment table entry 530 in a segment table. The table origin (eitherwith 12 zeros appended on the right, or multiplied by 4096) is added tothe product of the index multiplied by 8 (or the index with three zerosappended on the right). The segment table entry contains either anorigin address to a page table or a segment frame absolute address(SFAA), either shown at 528. If the invalid (I) bit of the segment tableentry is equal to one then the segment table entry is invalid and anexception condition is indicated.

At 538, the STE format control (FC) bit of the segment table isexamined. If the STE format control is one then the segment table entry530 contains a segment frame absolute address (SFAA) 552 and dynamicaddress translation continues with reference to node 562 in FIG. 5C.Otherwise, the segment table entry obtained from the segment tablecontains a page table origin address and dynamic address translationcontinues with reference to node 560 in FIG. 5B.

With reference now being made to FIG. 5B. If the STE format control inthe segment table entry is zero then the segment table entry obtainedfrom the segment table contains an origin address to the next lowertable in the hierarchy of translation tables. The next lower table tothe segment table is a page table. The page table origin 528, obtainedfrom segment table entry 530 of FIG. 5A, is arithmetically added, at538, with a Page Index (PX) 534 portion of the virtual address toreference page table entry 542 in a page table. The page table entrycontains a page frame real address (PFRA) 546. When the leftmost bits ofthe page frame real address are concatenated, at 548, with a byte index(BX) 536 portion of the virtual address, a 64-bit real address 550 isobtained. The real 64-bit address may be further subjected to aprefixing operation to form an absolute address. The translated virtualaddress references a desired 4 Kilobyte (4096 bytes) block of data inmain storage or memory.

Preferably, information used in dynamic translation of a virtual addressto a memory address is stored in a translation lookaside buffer entrytag along with the address of the block of memory associated with thevirtual address. Subsequent storage access can quickly translate avirtual address by comparing ASCE information and virtual addressinformation with translation lookaside buffer tags. If a tag is found tobe that of the virtual address, the translation lookaside buffer addressof the block of memory can be used instead of performing the slowsequential access of each translation table involved. In one embodiment,the page frame real address (PFRA) along with a tag consisting of, forexample, the ASCE and the RX, SX, and PX portions of the virtual addressare stored in an entry of the translation lookaside buffer 544.Subsequent translation of this virtual address is thereafter derivedfrom the information stored in the translation lookaside buffer.

With reference now being made to FIG. 5C. If the STE format control inthe segment table entry 530 is one then the segment table entry containsa segment frame absolute address (SFAA) 552. When the leftmost bits ofthe segment frame absolute address are concatenated, at 554, with a pageindex 534 portion and a byte index 536 portion of the virtual address, a64-bit absolute address 556 is obtained. The translated virtual addressreferences a desired large block of data in main storage or memory. Thelarge block of data is at least 1 megabyte (1,048,576 bytes) in size.

In one embodiment, the segment frame absolute address (SFAA) along withthe RX and SX portions of the virtual address are stored in atranslation lookaside buffer 544. Subsequent translation of this virtualaddress is thereafter derived from the information stored in thetranslation lookaside buffer.

Translation Table Entry Formats

Embodiments of the various translation table entries in the hierarchy oftranslation tables used in translation are as follows.

Region Table Entries

The term “region table entry” means a region first table entry, regionsecond table entry, or region third table entry. The entries fetchedfrom the region first table, region second table, and region third tablehave the following formats. The level (first, second, or third) of thetable containing an entry is identified by the table type (TT) bits inthe entry.

In one embodiment, the formats of the region first table entry, theregion second table entry, and the region third table entry are asfollows:

Region Second Table Origin, Region Third Table Origin, and Segment TableOrigin:

A region first table entry contains a region second table origin. Aregion second table entry contains a region third table origin. A regionthird table entry contains a segment table origin. The followingdescription applies to each of the three table origins. Bits 0-51 of theentry, with 12 zeros appended on the right, form a 64-bit address thatdesignates the beginning of the next lower level table.

DAT Protection Bit (P):

When enhanced DAT applies, bit 54 is treated as being OR'ed with the DATprotection bit in each subsequent region table entry, segment tableentry, and, when applicable, page table entry used in the translation.Thus, when the bit is one, DAT protection applies to the entire regionor regions specified by the region table entry. When the enhanced DATfacility is not installed, or when the facility is installed but theenhanced DAT enablement control is zero, bit 54 of the region tableentry is ignored.

Region Second Table Offset, Region Third Table Offset, and Segment TableOffset (TF):

A region first table entry contains a region second table offset. Aregion second table entry contains a region third table offset. A regionthird table entry contains a segment table offset. The followingdescription applies to each of the three table offsets. Bits 56 and 57of the entry specify the length of a portion of the next lower leveltable that is missing at the beginning of the table, that is, the bitsspecify the location of the first entry actually existing in the nextlower level table. The bits specify the length of the missing portion inunits of 4,096 bytes, thus making the length of the missing portionvariable in multiples of 512 entries. The length of the missing portion,in units of 4,096 bytes, is equal to the TF value. The contents of theoffset field, in conjunction with the length field, bits 62 and 63, areused to establish whether the portion of the virtual address (RSX, RTX,or SX) to be translated by means of the next lower level tabledesignates an entry that actually exists in the table.

Region Invalid Bit (I):

Bit 58 in a region first table entry or region second table entrycontrols whether the set of regions associated with the entry isavailable. Bit 58 in a region third table entry controls whether thesingle region associated with the entry is available. When bit 58 iszero, address translation proceeds by using the region table entry. Whenthe bit is one, the entry cannot be used for translation.

Table Type Bits (TT):

Bits 60 and 61 of the region first table entry, region second tableentry, and region third table entry identify the level of the tablecontaining the entry, as follows: Bits 60 and 61 must identify thecorrect table level, considering the type of table designation that isthe ASCE being used in the translation and the number of table levelsthat have so far been used; otherwise, a translation specificationexception is recognized. The following table shows the table type bits:

Table Type bits for region table Entries Bits 60 and 61 Region-TableLevel 11 First 10 Second 01 Third

Region Second Table Length, Region Third Table Length, and Segment TableLength (TL):

A region first table entry contains a region second table length. Aregion second table entry contains a region third table length. A regionthird table entry contains a segment table length. The followingdescription applies to each of the three table lengths. Bits 62 and 63of the entry specify the length of the next lower level table in unitsof 4,096 bytes, thus making the length of the table variable inmultiples of 512 entries. The length of the next lower level table, inunits of 4,096 bytes, is one more than the TL value. The contents of thelength field, in conjunction with the offset field, bits 56 and 57, areused to establish whether the portion of the virtual address (RSX, RTX,or SX) to be translated by means of the next lower level tabledesignates an entry that actually exists in the table. All other bitpositions of the region table entry are reserved for possible futureextensions and should contain zeros; otherwise, the program may notoperate compatibly in the future. When enhanced DAT applies, thereserved bit positions of the region table entry should contain zeroseven if the table entry is invalid.

Segment Table Entries

When enhanced DAT does not apply, or when enhanced DAT applies and theSTE format control, bit 53 of the segment table entry is zero, the entryfetched from the segment table, in one embodiment, has the followingformat:

When enhanced DAT applies and the STE format control is one, the entryfetched from the segment table, in one embodiment, has the followingformat:

Selected fields in the segment table entry are allocated as follows:

Page Table Origin:

When enhanced DAT does not apply, or when enhanced DAT applies but theSTE format control, bit 53 of the segment table entry, is zero, bits0-52, with 11 zeros appended on the right, form a 64-bit address thatdesignates the beginning of a page table. It is unpredictable whetherthe address is real or absolute.

Segment Frame Absolute Address (SFAA):

When enhanced DAT applies and the STE format control is one, bits 0-43of the entry, with 20 zeros appended on the right, form the 64-bitabsolute address of the segment.

ACCF Validity Control (AV):

When enhanced DAT applies and the STE format control is one, bit 47 isthe access control bits and fetch protection bit (ACCF) validitycontrol. When the AV control is zero, bits 48-52 of the segment tableentry are ignored. When the AV control is one, bits 48-52 are used asdescribed below.

Access Control Bits (ACC):

When enhanced DAT applies, the STE format control is one, and the AVcontrol is one, bits 48-51 of the segment table entry contain the accesscontrol bits that may be used for any key controlled access checkingthat applies to the address.

Fetch Protection Bit (F):

When enhanced DAT applies, the STE format control is one, and the AVcontrol is one, bit 52 of the segment table entry contains the fetchprotection bit that may be used for any key controlled access checkingthat applies to the address.

STE Format Control (FC):

When enhanced DAT applies, bit 53 is the format control for the segmenttable entry, as follows:

When the FC bit is zero, bits 0-52 of the entry form the page tableorigin, and bit 55 is reserved.

When the FC bit is one, bits 0-43 of the entry form the segment frameabsolute address, bit 47 is the ACCF validity control, bits 48-51 arethe access control bits, bit 52 is the fetch protection bit, and bit 55is the change recording override. When enhanced DAT does not apply, bit53 is ignored.

DAT Protection Bit (P):

Bit 54, when one, indicates that DAT protection applies to the entiresegment.

When enhanced DAT does not apply, bit 54 is treated as being OR'ed withthe DAT protection bit in the page table entry used in the translation.

When enhanced DAT applies, the DAT protection bit in any and all regiontable entries used in the translation are treated as being OR'ed withthe DAT protection bit in the segment table entry; when the STE formatcontrol is zero, the DAT protection bit in the STE is further treated asbeing OR'ed with the DAT protection bit in the page table entry.

Change Recording Override (CO):

When enhanced DAT applies, and the STE format control is one, bit 55 ofthe segment table entry is the change recording override for thesegment. When enhanced DAT does not apply, or when enhanced DAT appliesbut the STE format control is zero, bit 55 of the segment table entry isignored.

Segment Invalid Bit (I):

Bit 58 controls whether the segment associated with the segment tableentry is available.

When the bit is zero, address translation proceeds by using the segmenttable entry.

When the bit is one, the segment table entry cannot be used fortranslation.

Common Segment Bit (C): Bit 59 controls the use of the translationlookaside buffer copies of the segment table entry. When enhanced DATdoes not apply or when enhanced DAT applies but the format control iszero, bit 59 also controls the use of the translation lookaside buffercopies of the page table designated by the segment table entry.

A zero identifies a private segment; in this case, the segment tableentry and any page table it designates may be used only in associationwith the segment table origin that designates the segment table in whichthe segment table entry resides.

A one identifies a common segment; in this case, the segment table entryand any page table it designates may continue to be used for translatingaddresses corresponding to the segment index, even though a differentsegment table is specified.

However, translation lookaside buffer copies of the segment table entryand any page table for a common segment are not usable if the privatespace control, bit 55, is one in the ASCE used in the translation or ifthat ASCE is a real space designation. The common segment bit must bezero if the segment table entry is fetched from storage during atranslation when the private space control is one in the ASCE beingused. Otherwise, a translation specification exception is recognized.

Table Type Bits (TT):

Bits 60 and 61 of the segment table entry are 00 binary to identify thelevel of the table containing the entry. The meanings of all possiblevalues of bits 60 and 61 in a region table entry or segment table entryare as follows:

Table Type Bits 60, 61 Bits 60 and 61 Table Level 11 Region-first 10Region-second 01 Region-third 00 Segment

Bits 60 and 61 must identify the correct table level, considering thetype of table designation that is the ASCE being used in the translationand the number of table levels that have so far been used; otherwise, atranslation specification exception is recognized. All other bitpositions of the segment table entry are reserved for possible futureextensions and should contain zeros; otherwise, the program may notoperate compatibly in the future. When enhanced DAT applies, thereserved bit positions of the segment table entry should contain zeroseven if the table entry is invalid.

Page Table Entries

In one embodiment, the entry fetched from the page table has thefollowing format:

Selected fields in the page table entry are allocated as follows:

Page Frame Real Address (PFRA):

Bits 0-51 provide the leftmost bits of a real storage address. Whenthese bits are concatenated with the 12-bit byte index field of thevirtual address on the right, a 64-bit real address is obtained.

Page Invalid Bit (I):

Bit 53 controls whether the page associated with the page table entry isavailable. When the bit is zero, address translation proceeds by usingthe page table entry. When the bit is one, the page table entry cannotbe used for translation.

DAT Protection Bit (P):

Bit 54 controls whether store accesses can be made in the page. Thisprotection mechanism is in addition to the key controlled protection andlow address protection mechanisms. The bit has no effect on fetchaccesses. If the bit is zero, stores are permitted to the page, subjectto the following additional constraints:

The DAT protection bit being zero in the segment table entry used in thetranslation.

When enhanced DAT applies, the DAT protection bit being zero in allregion table entries used in the translation.

Other Protection Mechanisms

If the bit is one, stores are disallowed. When no higher priorityexception conditions exist, an attempt to store when the DAT protectionbit is one causes a protection exception to be recognized. The DATprotection bit in the segment table entry is treated as being OR'ed withbit 54 when determining whether DAT protection applies to the page. Whenenhanced DAT applies, the DAT protection bit in any region table entriesused in translation are also treated as being OR'ed with bit 54 whendetermining whether DAT protection applies.

Change Recording Override (CO):

When enhanced DAT does not apply, bit 55 of the page table entry mustcontain zero; otherwise, a translation specification exception isrecognized as part of the execution of an instruction using that entryfor address translation. When enhanced DAT applies and the STE formatcontrol is zero, bit 55 of the page table entry is the change recordingoverride for the page.

Bit position 52 of the entry must contain zero; otherwise, a translationspecification exception is recognized as part of the execution of aninstruction using that entry for address translation. Bit positions56-63 are not assigned and are ignored.

Another Embodiment of the Dynamic Translation

This section describes the translation process as it is performedimplicitly before a virtual address is used to access main storage.

Translation of a virtual address is controlled by the DAT mode bit andaddress space control bits in the program status word and by the ASCEsin control registers 1, 7, and 13 and as specified by the accessregisters. When the ASCE used in a translation is a region first tabledesignation, the translation is performed by means of a region firsttable, region second table, region third table, segment table, and pagetable, all of which reside in real or absolute storage. When the ASCE isa lower level type of table designation (region second tabledesignation, region third table designation, or segment tabledesignation) the translation is performed by means of only the tablelevels beginning with the designated level, and the virtual address bitsthat would, if non-zero, require use of a higher level or levels oftable must be all zeros; otherwise, an ASCE-type exception isrecognized. When the ASCE is a real space designation, the virtualaddress is treated as a real address, and table entries in real orabsolute storage are not used.

The ASCE used for a particular address translation is called theeffective ASCE. Accordingly, when a primary virtual address istranslated, the contents of control register 1 are used as the effectiveASCE. Similarly, for a secondary virtual address, the contents ofcontrol register 7 are used; for an AR specified virtual address, theASCE specified by the access register is used; and for a home virtualaddress, the contents of control register 13 are used.

When the real space control in the effective ASCE is zero, thedesignation type in the ASCE specifies the table designation type:region first table, region second table, region third table, or segmenttable. The corresponding portion of the virtual address (region firstindex, region second index, region third index, or segment index) ischecked against the table length field in the designation, and it isadded to the origin in the designation to select an entry in thedesignated table. If the selected entry is outside its table, asdetermined by the table length field in the designation, or if the I bitis one in the selected entry, a region first translation, region secondtranslation, region third translation, or segment translation exceptionis recognized, depending on the table level specified by thedesignation. If the table type bits in the selected entry do notindicate the expected table level, a translation specification exceptionis recognized.

The table entry selected by means of the effective ASCE designates thenext lower level table to be used. If the current table is a regionfirst table, region second table, or region third table, the nextportion of the virtual address (region second index, region third index,or segment index, respectively) is checked against the table offset andtable length fields in the current table entry, and it is added to theorigin in the entry to select an entry in the next lower level table. Ifthe selected entry in the next table is outside its table, as determinedby the table offset and table length fields in the current table entry,or if the I bit is one in the selected entry, a region secondtranslation, region third translation, or segment translation exceptionis recognized, depending on the level of the next table. If the tabletype bits in the selected entry do not indicate the expected tablelevel, a translation specification exception is recognized.

Processing of portions of the virtual address by means of successivetable levels continues until a segment table entry has been selected.The segment table entry contains a page protection bit that applies toall pages in the specified segment.

The page index portion of the virtual address is added to the page tableorigin in the segment table entry to select an entry in the page table.If the I bit is one in the page table entry, a page translationexception is recognized. The page table entry contains the leftmost bitsof the real address that represents the translation of the virtualaddress, and it contains a page protection bit that applies only to thepage specified by the page table entry.

The byte index field of the virtual address is used unchanged as therightmost bit positions of the real address.

In order to eliminate the delay associated with references totranslation tables in real or absolute storage, the information fetchedfrom the tables normally is also placed in a special buffer, thetranslation lookaside buffer, and subsequent translations involving thesame table entries may be performed by using the information recorded inthe translation lookaside buffer. The translation lookaside buffer mayalso record virtual equals real translations related to a real spacedesignation.

Whenever access to real or absolute storage is made during the addresstranslation process for the purpose of fetching an entry from a regiontable, segment table, or page table, key controlled protection does notapply.

Lookup in a Table Designated by an ASCE

The DT control, bits 60-61 of the effective ASCE, specifies both thetable designation type of the ASCE and the portion of the virtualaddress that is to be translated by means of the designated table, asfollows:

Translation by means of Designated Table Virtual-Address Bits 60 PortionTranslated and 61 Designation Type by the Table 11 Region-first-tableRegion first Index (bits 0-10)  10 Region-second-table Region secondIndex (bits 11-21) 01 Region-third-table Region third Index (bits 22-32)00 Segment-table Segment Index (bits 33-43)

When bits 60 and 61 have the value 11 binary, the region first indexportion of the virtual address, in conjunction with the region firsttable origin contained in the ASCE, is used to select an entry from theregion first table. The 64-bit address of the region first table entryin real or absolute storage is obtained by appending 12 zeros to theright of bits 0-51 of the region first table designation and adding theregion first index with three rightmost and 50 leftmost zeros appended.As part of the region first table lookup process, bits 0 and 1 of thevirtual address (which are bits 0 and 1 of the region first index) arecompared against the table length, bits 62 and 63 of the region firsttable designation, to establish whether the addressed entry is withinthe region first table. If the value in the table length field is lessthan the value in the corresponding bit positions of the virtualaddress, a region first translation exception is recognized. Thecomparison against the table length may be omitted if the equivalent ofa region first table entry in the translation lookaside buffer is usedin the translation. The entry fetched from the region first tabledesignates the beginning and specifies the offset and length of thecorresponding region second table.

When bits 60 and 61 of the ASCE have the value 10 binary, the regionsecond index portion of the virtual address, in conjunction with theregion second table origin contained in the ASCE, is used to select anentry from the region second table. Bits 11 and 12 of the virtualaddress (which are bits 0 and 1 of the region second index) are comparedagainst the table length in the ASCE. If the value in the table lengthfield is less than the value in the corresponding bit positions of thevirtual address, a region second translation exception is recognized.The comparison against the table length may be omitted if the equivalentof a region second table entry in the translation lookaside buffer isused in the translation. The region second table lookup process isotherwise the same as the region first table lookup process; the entryfetched from the region second table designates the beginning andspecifies the offset and length of the corresponding region third table.

When bits 60 and 61 of the ASCE have the value 01 binary, the regionthird index portion of the virtual address, in conjunction with theregion third table origin contained in the ASCE, is used to select anentry from the region third table. Bits 22 and 23 of the virtual address(which are bits 0 and 1 of the region third index) are compared againstthe table length in the ASCE. If the value in the table length field isless than the value in the corresponding bit positions of the virtualaddress, a region third translation exception is recognized. The regionthird table lookup process is otherwise the same as the region firsttable lookup process, including the checking of the table type bits inthe region third table entry. The entry fetched from the region thirdtable designates the beginning and specifies the offset and length ofthe corresponding segment table.

When bits 60 and 61 of the ASCE have the value 00 binary, the segmentindex portion of the virtual address, in conjunction with the segmenttable origin contained in the ASCE, is used to select an entry from thesegment table. Bits 33 and 34 of the virtual address (which are bits 0and 1 of the segment index) are compared against the table length in theASCE. If the value in the table length field is less than the value inthe corresponding bit positions of the virtual address, a segmenttranslation exception is recognized. The comparison against the tablelength may be omitted if the equivalent of a segment table entry in thetranslation lookaside buffer is used in the translation. The segmenttable lookup process is otherwise the same as the region first tablelookup process, including the checking of the table type bits in thesegment table entry. Processing is as follows:

When enhanced DAT does not apply, or when enhanced DAT applies but theSTE format control is zero, the entry fetched from the segment tabledesignates the beginning of the corresponding page table, and processingcontinues as described in “Page Table Lookup”, below.

When enhanced DAT applies and the STE format control is one, the entryfetched from the segment table contains the leftmost bits of the segmentframe absolute address. If the DAT protection bit is one either in anyregion table entry used in the translation or in the segment tableentry, and the storage reference for which the translation is beingperformed is a store, a protection exception is recognized.

Lookup in a Table Designated by a Region Table Entry

When the effective ASCE is a region table designation, a region tableentry is selected as described in the preceding section. Then thecontents of the selected entry and the next index portion of the virtualaddress are used to select an entry in the next lower level table, whichmay be another region table or a segment table. When the table entryselected by means of the ASCE is a region first table entry, the regionsecond index portion of the virtual address, in conjunction with theregion second table origin contained in the region first table entry, isused to select an entry from the region second table. The 64-bit addressof the region second table entry in real or absolute storage is obtainedby appending 12 zeros to the right of bits 0-51 of the region firsttable entry and adding the region second index with three rightmost and50 leftmost zeros appended.

When forming the address of a region second, region third, or segmenttable entry, it is unpredictable whether prefixing, if any, is appliedto the respective table origin contained in the higher level table entrybefore the addition of the table index value, or prefixing is applied tothe table entry address that is formed by the addition of the tableorigin and table index value.

As part of the region second table lookup process, bits 11 and 12 of thevirtual address (which are bits 0 and 1 of the region second index) arecompared against the table offset, bits 56 and 57 of the region firsttable entry, and against the table length, bits 62 and 63 of the regionfirst table entry, to establish whether the addressed entry is withinthe region second table. If the value in the table offset field isgreater than the value in the corresponding bit positions of the virtualaddress, or if the value in the table length field is less than thevalue in the corresponding bit positions of the virtual address, aregion second translation exception is recognized.

The region second table designates the beginning and specifies theoffset and length of the corresponding region third table.

When the table entry selected by means of the ASCE is a region secondtable entry, or if a region second table entry has been selected bymeans of the contents of a region first table entry, the region thirdindex portion of the virtual address, in conjunction with the regionthird table origin contained in the region second table entry, is usedto select an entry from the region third table. Bits 22 and 23 of thevirtual address (which are bits 0 and 1 of the region third index) arecompared against the table offset and table length in the region secondtable entry. A region third translation exception is recognized if thetable offset is greater than bits 22 and 23 or if the table length isless than bits 22 and 23. The region third table lookup process isotherwise the same as the region second table lookup process. The entryfetched from the region third table designates the beginning andspecifies the offset and length of the corresponding segment table.

When the table entry selected by means of the ASCE is a region thirdtable entry, or if a region third table entry has been selected by meansof the contents of a region second table entry, the segment indexportion of the virtual address, in conjunction with the segment tableorigin contained in the region third table entry, is used to select anentry from the segment table. Bits 33 and 34 of the virtual address(which are bits 0 and 1 of the segment index) are compared against thetable offset and table length in the region third table entry. A segmenttranslation exception is recognized if the table offset is greater thanbits 33 and 34 or if the table length is less than bits 33 and 34. Atranslation specification exception is recognized if (1) the privatespace control, bit 55, in the ASCE is one and (2) the common segmentbit, bit 59, in the entry fetched from the segment table is one. Thesegment table lookup process is otherwise the same as the region secondtable lookup process. Processing is as follows:

When enhanced DAT does not apply, or when enhanced DAT applies but theSTE format control is zero, the entry fetched from the segment tabledesignates the beginning of the corresponding page table, and processingcontinues as described in “Page Table Lookup”, below.

When enhanced DAT applies and the STE format control is one, the entryfetched from the segment table contains the leftmost bits of the segmentframe absolute address. If the DAT protection bit is one either in anyregion table entry used in the translation or in the segment tableentry, and the storage reference for which the translation is beingperformed is a store, a protection exception is recognized.

Page Table Lookup

When enhanced DAT does not apply, or when enhanced DAT applies but theSTE format control is zero, the page index portion of the virtualaddress, in conjunction with the page table origin contained in thesegment table entry, is used to select an entry from the page table.

The 64-bit address of the page table entry in real or absolute storageis obtained by appending 11 zeros to the right of the page table originand adding the page index, with three rightmost and 53 leftmost zerosappended. A carry out of bit position 0 cannot occur.

The entry fetched from the page table indicates the availability of thepage and contains the leftmost bits of the page frame real address. Thepage invalid bit, bit 53, is inspected to establish whether thecorresponding page is available. If this bit is one, a page translationexception is recognized. If bit position 52 contains a one, atranslation specification exception is recognized. When enhanced DATdoes not apply, or enhanced DAT applies and the STE format control iszero, a translation specification exception is also recognized if bitposition 55 contains a one. If the DAT protection bit is one either inthe segment table entry used in the translation, in the page tableentry, or, when enhanced DAT applies, in any region table entry usedduring the translation, and the storage reference for which thetranslation is being performed is a store, a protection exception isrecognized.

Formation of the Real and Absolute Addresses

When the effective ASCE is a real space designation, bits 0-63 of thevirtual address are used directly as the real storage address. The realaddress may be further subjected to prefixing to form an absoluteaddress. When the effective ASCE is not a real space designation and noexceptions in the translation process are encountered, the followingconditions apply:

When the enhanced DAT does not apply, or when enhanced DAT applies butthe STE format control is zero, the page frame real address is obtainedfrom the page table entry. The page frame real address and the byteindex portion of the virtual address are concatenated, with the pageframe real address forming the leftmost part. The result is the realstorage address which corresponds to the virtual address. The realaddress may be further subjected to prefixing to form an absoluteaddress.

When enhanced DAT applies and the STE format control is one, the segmentframe absolute address and the page index and byte index portions of thevirtual address are concatenated, left to right, respectively, to formthe absolute address which corresponds to the virtual address.

Recognition of Exceptions During Translation

Invalid addresses and invalid formats can cause exceptions to berecognized during the translation process. Exceptions are recognizedwhen information contained in table entries is used for translation andis found to be incorrect.

Reference is now being made to FIG. 6 which illustrates a flow diagramof one embodiment of dynamic address translation to the point ofobtaining a format control field from a segment table entry.

At 602, a virtual address to be translated is obtained. At 604, theorigin address of the highest translation table used in translation ofthe virtual address is obtained. The origin address of the firsttranslation table used in translation depends on the ASCE and the DTbits. At 606, a portion of the virtual address is used to reference theappropriate table entry in the translation table. If, at 608, the entryfetched from the translation table is not a segment table entry then thesegment table in the hierarchy of translation tables has not yet beenreferenced. In this case, at 610, the origin of a next lower table inthe hierarchy of translation tables is obtained from the table entry.The appropriate portion of the virtual address is used to reference thecorresponding table entry in the next lower table used in translation.

For example, if the table origin address of the first translation tableto be used in translation is a region first table then the RFX portionof the virtual address is used to reference a region first table entrywith the region first table. If the table origin address is to a regionsecond table then the RSX portion of the virtual address is used toreference a region second table entry within the region second table. Ifthe table origin address is to a region third table then the RTX portionof the virtual address is used to reference a region third table entrywithin the region third table. If the table origin address is to asegment table then the SX portion of the virtual address is used toreference a segment table entry within the segment table. Successivetables are referenced until the segment table entry has been fetched.

Once the segment table entry has been fetched, the segment table entry(STE) format control bit is examined, at 612, to determine if formatcontrol is enabled for this particular virtual address. If the STEformat control is zero then dynamic address translation occurs withrespect to node 614. If the STE format control is one then dynamicaddress translation occurs with respect to node 616.

Dynamic Address Translation (STE Format Control is Zero)

Reference is now being made to FIG. 7 which illustrates a continuationof the flow diagram from node 614 of FIG. 6 when the STE format controlis zero.

At 710, an origin address to a page table is obtained from the segmenttable entry. At 712, a PX portion of the virtual address is used toreference a page table entry in the page table. At 714, a page framereal address (PFRA) is obtained from the page table entry. An Invalid(I) bit is obtained from the page table entry. If, at 716, the Invalid(I) bit is one then, at 718, translation of the virtual address cannotcontinue using this page table entry because the entry has been markedas being invalid. Further translation of the virtual address using thispage table entry stops 722. If, at 716, the Invalid (I) bit is zerothen, at 720, the page frame real address (PFRA) is combined with a BXportion of the virtual address to generate a real address. The realaddress may be further subject to a prefixing operation to form anabsolute address. At 724, the real address is used to access a block ofdata addressed by the translated virtual address.

Dynamic Address Translation (STE Format Control is One)

Reference is now being made to FIG. 8 which illustrates a continuationof the flow diagram from node 616 of FIG. 6.

At 810, a segment frame absolute address (SFAA) is obtained from aportion of the segment table entry. An invalid (I) bit is obtained fromthe segment table entry. If, at 812, the invalid (I) bit is one then, at814, further translation of the virtual address cannot proceed using thesegment table entry because it has been marked as being invalid. In oneembodiment, an exception code is returned to the program entityrequesting translation. Further translation of this virtual addressusing this segment table entry stops 818.

If, at 812, the invalid (I) bit is zero then, at 816, the segment frameabsolute address (SFAA) is combined with PX and BX portion of thevirtual address to generate an absolute address to a desired large blockof data in main storage or in memory. At 820, the desired large block ofdata addressed by the translated virtual address is accessed.

At each table entry, the invalid bit is examined to determine thevalidity of the table entry obtained. Other translation protectionmechanisms which protect the block of data addressed by the translatedvirtual address are discussed herein further.

In another embodiment, restricting information is obtained from thetranslation table entry. The restricting information is used forrestricting the access to a restricted portion of the virtual addressrange. The access to the desired large block of data addressed by thetranslated address is thereafter permitted to only the restrictedportion of the address range. The restricting information is any one ofa table offset or a table length.

In yet another embodiment, information used in the translation of thevirtual address is stored in at least one translation lookaside buffer.A subsequent translation of a subsequent virtual address into anabsolute address of the block of data in main storage is performed usingthe stored information from the translation lookaside buffer rather thanthe hierarchy of translation tables.

In yet another embodiment, if the translation is not native to themachine architecture, a predetermined software routine is identified foremulating the translation. The predetermined software routine contains aplurality of instructions. The predetermined software routine isexecuted.

Protection of the Addressed Data Block

Once the virtual address has been translated using the enhanced DATfacility, as described herein, the desired block of data in main storageor memory addressed by the translated virtual address may be subjectedto additional protection mechanism.

DAT Protection

The DAT protection function controls access to virtual storage by usingthe DAT protection bit in each page table entry and segment table entry,and, when the enhanced DAT facility is installed, in each region tableentry. It provides protection against improper storing.

The DAT protection bit (bit 54) of the page table entry controls whetherstoring is allowed into the corresponding 4 Kilobyte page. When the bitis zero, both fetching and storing are permitted; when the bit is one,only fetching is permitted. When an attempt is made to store into aprotected page, the contents of the page remain unchanged, the unit ofoperation or the execution of the instruction is suppressed, and aprogram interruption for protection takes place.

The DAT protection bit (bit 54) of the segment table entry controlswhether storing is allowed into the corresponding 1 Megabyte segment, asfollows:

When enhanced DAT does not apply, or when enhanced DAT applies and theSTE format control is zero, the DAT protection bit of the segment tableentry is treated as being OR'ed into the DAT protection bit position ofeach entry in the page table designated by the segment table entry.Thus, when the segment table entry DAT protection bit is one, the effectis as if the DAT protection bit were one in each entry in the designatedpage table.

When enhanced DAT applies and the STE format control is one, the DATprotection bit of the segment table entry controls whether storing isallowed into the corresponding 1 Megabyte segment. When the bit is zero,both fetching and storing are permitted; when the bit is one, onlyfetching is permitted. When an attempt is made to store into a protectedsegment, the contents of the segment remain unchanged, the unit ofoperation or the execution of the instruction is suppressed, and aprogram interruption for protection takes place.

When enhanced DAT applies, the DAT protection bit of the region tableentry, controls whether storing is allowed into the correspondingregion(s). The DAT protection bit in a region table entry is treated asbeing OR'ed into the DAT protection bit position of any subsequentregion table entry and segment table entry that is used in thetranslation. When the STE format control bit is zero, the DAT protectionbit is further propagated to the page table entry.

DAT protection applies to all store-type references that use a virtualaddress.

Reference is now being made to FIG. 9 which illustrates a flow diagramof one embodiment of obtaining the DAT protection bit from the segmenttable entry used in translation.

At 902, a virtual address to be translated is obtained. At 904, theorigin of a first translation table used in translation of the virtualaddress is obtained. At 906, a portion of the virtual address is used toreference an entry in a translation table in a manner previouslydiscussed. At 908, a real or absolute address is generated from eitherthe obtained segment frame absolute address (SFAA) or the page framereal address (PFRA).

At 910, a DAT protection (P) bit is obtained from each entry of thetranslation tables used in translation of the virtual address. It shouldbe understood that the effective level of DAT protection is the logicalOR of multiple P bits obtained from each of the table entries used intranslation. At 912, the DAT protection bit is examined to determinewhether the block of data addressed by the translated virtual address isDAT protected. If, at 912, the DAT protection (P) bit is zero then, at914, store operations are permitted to the block of data addressed bythe translated virtual address. If, at 912, the DAT protection (P) bitis one then, at 916, store operations are prevented to the block of dataaddressed by the translated virtual address. Alternatively, a level ofprotection indicated by the DAT protection field is applied to allstore-type references that use the virtual address. If the DATprotection field is enabled then a protection exception condition isindicated if a store is attempted to the desired block of data addressedby the translated virtual address.

Key Controlled Protection

When key controlled protection applies to a storage access, a store ispermitted only when the storage key matches the access key associatedwith the request for storage access; a fetch is permitted when the keysmatch or when the fetch protection bit of the storage key is zero. Thekeys are said to match when the four access control bits of the storagekey are equal to the access key, or when the access key is zero. Theprotection action is summarized as follows.

Storage-Protection-Override Control Conditions Is Access toFetch-Protection Storage Permitted Bit of Storage Key Key Relation FetchStore 0 Match Yes Yes 0 Mismatch Yes No 1 Match Yes Yes 1 Mismatch No NoExplanation: Match The four access-control bits of the storage key areequal to the access key, or the access key is zero. Yes Access ispermitted. No Access is not permitted. On fetching, the information isnot made available to the program; on storing, the contents of thestorage location are not changed.

In one example, Bit 39 of control register 0 is thestorage-protection-override control. When this bit is one,storage-protection override is active. When this bit is zero,storage-protection override is inactive. When storage-protectionoverride is active, key-controlled storage protection is ignored forstorage locations having an associated storage-key value of, forexample, 9. When storage-protection override is inactive, no specialaction is taken for a storage-key value of 9.

Storage-protection override applies to instruction fetch and to thefetch and store accesses of instructions whose operand addresses arelogical, virtual, or real. It does not apply to accesses made for thepurpose of channel-program execution or for the purpose ofchannel-subsystem monitoring.

Storage-protection override has no effect on accesses which are notsubject to key-controlled protection.

Summary of Protective Action

When the access to storage is initiated by the CPU and key controlledprotection applies, the PSW Key is the access key, except that theaccess key is specified in a general register for the first operand ofMOVE TO SECONDARY and MOVE WITH DESTINATION KEY, for the second operandof MOVE TO PRIMARY, MOVE WITH KEY, and MOVE WITH SOURCE KEY, and foreither the first or the second operand of MOVE PAGE. The PSW Keyoccupies bit positions 8-11 of the current program status word.

When a CPU access is prohibited because of key controlled protection,the execution of the instruction is terminated, and a programinterruption for a protection exception takes place. However, the unitof operation or the execution of the instruction may be suppressed.

Storage Keys

A storage key is associated with each 4 Kilobyte block of storage thatis available in the configuration. Storage keys are not part ofaddressable storage. In one embodiment, the storage key has thefollowing format:

The bit positions in the storage key are allocated as follows:

Access Control Bits (ACC):

If a reference is subject to key controlled protection, the four accesscontrol bits are matched with the four-bit access key when informationis stored and when information is fetched from a location that isprotected against fetching.

Fetch Protection Bit (F):

If a reference is subject to key controlled protection, the fetchprotection bit controls whether key controlled protection applies tofetch-type references: a zero indicates that only store-type referencesare monitored and that fetching with any access key is permitted; a oneindicates that key controlled protection applies to both fetching andstoring.

Reference Bit (R):

The reference bit normally is set to one each time a location in thecorresponding storage block is referred to either for storing or forfetching of information.

Change Bit (C):

The change bit is set to one each time information is stored at alocation in the corresponding storage block.

When enhanced DAT applies, the following additional conditions are ineffect:

When the STE format control (FC, bit 53 of the segment table entry usedduring a translation) is zero, bit 55 of the page table entry usedduring translation is the change recording override (CO) for the page.When the CO bit in the page table entry is one, change recording isunpredictable for any store operations to the page.

When the format control bit (FC) in the segment table entry is one, thefollowing applies:

Bit position 47 of the segment table entry contains the ACCF validitycontrol. The ACCF validity control determines the validity of the accesscontrol and fetch protection bits in the STE. When the ACCF validitycontrol is zero, key controlled protection uses the access control andfetch protection bits in the storage key for the 4K byte blockcorresponding to the address.

When the ACCF validity control is one, bit positions 48-52 of thesegment table entry contain the access control bits and the fetchprotection bit for the segment. When determining accessibility to astorage operand, it is unpredictable whether bits 48-52 of the STE orbits 0-4 of the individual storage keys for the 4K byte blocks composingthe segment are examined.

Bit 55 of the segment table entry is the change recording override (CO)for the segment. When the CO bit in the segment table entry is one, itis unpredictable whether the change bit is set for any store operationsto the segment.

Storage Key Accesses

References to the storage key are handled as follows:

Whenever a reference to storage is made and key controlled protectionapplies to the reference, the four access control bits and the fetchprotection bit associated with the storage location are inspectedconcurrently and concurrently with the reference to the storagelocation. When (1) enhanced DAT does not apply, (2) enhanced DAT appliesbut the storage is accessed by means of a segment table entry in whichthe STE format control is zero, or (3) enhanced DAT applies, the storageis accessed by means of a segment table entry in which the STE formatcontrol is one, but the ACCF validity control is zero, the accesscontrol bits and the fetch protection bit are in bits 0-4 of the storagekey for the 4K byte block. When enhanced DAT applies and the storage isaccessed by means of a segment table entry in which both the STE formatcontrol and ACCF validity control are one, it is unpredictable whetherbits 0-4 of the storage key or bits 48-52 of the segment table entryprovide the access control bits and fetch protection bit. Furthermore,when the segment table entry provides the access control bits and fetchprotection bit, a buffered copy from the translation lookaside buffermay be used.

When enhanced DAT applies, and either (a) the STE format control iszero, and the change recording override is one in the page table entryused by DAT, or (b) the STE format control is one, and the changerecording override is one in the segment table entry used by DAT, it isunpredictable whether the CPU sets the change bit when performing astore operation. The change recording override may be buffered in thetranslation lookaside buffer copy of the PTE or STE.

When the conditional SSKE feature is not installed, the SET STORAGE KEYEXTENDED instruction causes all seven bits to be set concurrently in thestorage key. When the conditional SSKE feature is installed, the SETSTORAGE KEY EXTENDED instruction may be used to set all or portions ofthe storage key based on program specified criteria.

The INSERT STORAGE KEY EXTENDED instruction provides a consistent imageof bits 0-6 of the storage key for a 4K byte block. Similarly, theinstructions INSERT VIRTUAL STORAGE KEY and TEST PROTECTION provide aconsistent image of the access control bits and the fetch protectionbit.

The instruction RESET REFERENCE BIT EXTENDED modifies only the referencebit. All other bits of the storage key remain unchanged. The referencebit and change bit are examined concurrently to set the condition code.

The record of references provided by the reference bit is notnecessarily accurate. However, in the majority of situations, referencerecording approximately coincides with the related storage reference.The change bit may be set in cases when no storing has occurred.

As observed by other CPUs, storage key fetches and stores due toinstructions that explicitly manipulate a storage key (INSERT STORAGEKEY EXTENDED, INSERT VIRTUAL STORAGE KEY, RESET REFERENCE BIT EXTENDED,and SET STORAGE KEY EXTENDED) are ordered among themselves and amongstorage operand references as if the storage key accesses werethemselves storage operand fetches and stores, respectively.

Access Control and Fetch Protection (ACC/F)

A block of data in main storage or memory can be further protected byway of access control and fetch protection bits provided in the segmenttable entry.

Access Validity (AV) and Access Control (ACC)

Reference is now being made to FIG. 10 which illustrates one embodimentof a flow diagram of determining the access control protection to beapplied to a desired block of data addressed by the translated virtualaddress.

Dynamic address translation proceeds to the point wherein a segmenttable entry has been fetched from a segment table used in translation asdescribed in FIG. 6 to node 616. Address translation continues asdescribed in FIG. 8 to node 822 wherein an absolute address to a desiredblock of data in storage or memory has been obtained. The flow of FIG.10 begins at node 822.

At 1002, an access validity (AV) field is obtained from the segmenttable entry. At 1004, a determination is made whether the accessvalidity field in the segment table entry is enabled (AV=1). If theaccess validity field is zero then the access control (ACC) field in thesegment table entry is not valid. At 1006, the bits of the accesscontrol field are ignored. If the access validity field is enabled, thenthe access control field is valid. At 1008, the bits of the accesscontrol field are obtained from the segment table entry. At 1010, thelevel of access control protection indicated by the ACC field in thesegment table entry is applied to the desired block of data addressed bythe translated virtual address.

In another embodiment, store operations to the desired block of data arepermitted only if the access control field matches an access keyprovided by a program entity such as a Program Status Word or an operandof a program instruction being executed. A protection exception ispreferably indicated if a store is attempted at the desired block ofdata and the access control field does not match the access key.

In yet another embodiment, if the access validity field is enabled, aprotection exception is indicated if a fetch operation or a storeoperation is attempted at the desired block of memory and the segmentaccess control field does not match the program access control field.

Access Validity (AV) and Fetch Protection (F)

Reference is now being made to FIG. 11 which illustrates one embodimentof a flow diagram of determining the fetch protection to be applied to adesired block of data addressed by the translated virtual address.

Dynamic address translation proceeds to the point wherein a segmenttable entry has been fetched from a segment table used in translation asdescribed in FIG. 6 to node 616. Address translation continues asdescribed in FIG. 8 to node 822 wherein an absolute address to a desiredblock of data in storage or memory has been obtained. The flow of FIG.11 begins at node 822.

At 1102, an access validity (AV) field is obtained from the segmenttable entry. At 1104, a determination is made whether the accessvalidity field in the segment table entry is enabled (AV=1). If, at1104, the access validity field is zero then, at 1106, the fetchprotection bit is ignored. If, at 1104, the access validity field isenabled then, at 1108, the fetch protection bit is obtained from thesegment table entry. At 1110, the level of fetch protection indicated bythe F field in the segment table entry is applied to the desired blockof data addressed by the translated virtual address. Fetch operationsfrom the block of data addressed by the translated virtual address arepermitted only if the fetch protection field matches an access key. Theaccess key is provided by a Program Status Word or an operand of aprogram instruction being executed. Fetch operations from the desiredblock of data are permitted only if either the fetch protection field isdisabled or if both the fetch protection field is enabled and the accesscontrol field associated with the virtual address is equal to the accesskey. If the access key is zero, fetches from the desired block of dataare permitted.

In yet another embodiment, if the program access key is zero, storeoperations to the desired block of memory and fetch operations from thedesired block of memory are permitted.

In yet another embodiment, if the access validity field and the fetchprotection field are enabled, a protection exception is indicated inresponse to a fetch operation being attempted from the desired block ofmemory and the segment access control field not matching the programaccess control field.

Set Storage Key Extended (SSKE)

Storage keys can be set by means of a SET STORAGE KEY EXTENDED (SSKE)instruction. In one embodiment, the SSKE instruction has the followingformat:

The storage key for one or more 4K byte blocks is replaced by the valuein the first operand register. When the conditional SSKE facility isinstalled, certain functions of the key setting operation may bebypassed. When the conditional SSKE facility is not installed, or whenthe conditional SSKE facility is installed and both the MR and MC bitsof the M3 field are zero, the storage key for the 4K byte block that isaddressed by the contents of general register R2 is replaced by bitsfrom general register R1. The instruction completes without changing thecondition code.

When the conditional SSKE facility is installed and either or both ofthe MR and MC bits are one, the access control bits, fetch protectionbit, and, optionally, the reference bit and change bit of the storagekey that is addressed by the contents of general register R2 arecompared with corresponding bits in general register R1. If the comparedbits are equal, then no change is made to the key; otherwise, selectedbits of the key are replaced by the corresponding bits in generalregister R1. The storage key prior to any modification is inserted ingeneral register R1, and the result is indicated by the condition code.

When the enhanced DAT facility is installed, the above operations may berepeated for the storage keys of multiple 4K byte blocks within the same1 MB block, subject to the control of the multiple block control,described below. In one embodiment, the M3 field has the followingformat:

The bits of the M3 field are defined as follows:

Reserved:

Bit 0 is reserved.

Reference Bit Update Mask (MR):

The MR bit, bit 1 of the M3 field, controls whether updates to thereference bit in the storage key may be bypassed, as described below.

Change Bit Update Mask (MC):

The MC bit, bit 2 of the M3 field, controls whether updates to thechange bit in the storage key may be bypassed, as described below.

Multiple Block Control (MB):

The MB bit, bit 3 of the M3 field, controls whether the storage keys formultiple 4K byte blocks of storage may be set, as described in SettingStorage Keys in Multiple 4K Byte Blocks.

When the enhanced DAT facility is not installed, bit position 3 of theM3 field is reserved. When the conditional SSKE facility is installed,processing is as follows:

When both the MR and MC bits, bits 1 and 2 of the M3 field, are zero,the instruction completes as though the conditional SSKE facility wasnot installed. The storage key for the 4K byte block that is addressedby the contents of general register R2 is replaced by bits from generalregister R1, and the instruction completes without changing thecondition code.

When either or both the MR and MC bits are one, processing is asfollows:

Prior to any modification, the contents of the storage key for the 4Kbyte block that is addressed by general register R2 are placed in bitpositions 48-54 of general register R1, and bit 55 of general registerR1 is set to zero. Bits 0-47 and 56-63 of the register remain unchanged.If an invalid checking block code (CBC) is detected when fetching thestorage key, then (a) the entire storage key for the 4K byte block isreplaced by bits 56-62 of general register R1, (b) the contents of bitpositions 48-55 of general register R1 are unpredictable, and (c) theinstruction completes by setting condition code 3.

The access control bits and fetch protection bit of the storage key forthe designated 4K byte block are compared with the corresponding fieldsin bits 56-60 of general register R1. If the respective fields are notequal, the entire storage key for the 4K byte block is replaced by bitsfrom general register R1, and the instruction completes by settingcondition code 1. When the access control and fetch protection bits inthe storage key are equal to the respective bits in general register R1,processing continues as described below.

When both the MR and MC bits are one, the instruction completes bysetting condition code 0. The storage key remains unchanged in thiscase.

When the MR bit is zero and the MC bit is one, then the reference bit ofthe storage key for the designated 4K byte block is compared with bit 61of general register R1. If the bits are equal, the instruction completesby setting condition code 0. The storage key remains unchanged in thiscase. If the bits are not equal, then either (a) the entire storage keyfor the designated 4K byte block is replaced by the bits in generalregister R1, and the instruction completes by setting condition code 1;or (b) the reference bit for the storage key is replaced by bit 61 ofgeneral register R1, the change bit for the key is unpredictable, andthe instruction completes by setting condition code 2. It isunpredictable whether condition code 1 or 2 is set.

When the MC bit is zero and the MR bit is one, then the change bit ofthe storage key for the designated 4K byte block is compared with bit 62of general register R1. If the bits are equal, the instruction completesby setting condition code 0. The storage key remains unchanged in thiscase. If the bits are not equal, then either (a) the entire storage keyfor the designated 4K byte block is replaced by the bits in generalregister R1, and the instruction completes by setting condition code 1;or (b) the change bit for the storage key is replaced by bit 62 ofgeneral register R1, the reference bit for the key is unpredictable, andthe instruction completes by setting condition code 2. It isunpredictable whether condition code 1 or 2 is set.

When the enhanced DAT facility is not installed, or when the facility isinstalled but the multiple block control is zero, general register R2contains a real address. When the enhanced DAT facility is installed andthe multiple block control is one, general register R2 contains anabsolute address. In the 24-bit addressing mode, bits 40-51 of generalregister R2 designate a 4K byte block in real or absolute storage, andbits 0-39 and 52-63 of the register are ignored. In the 31-bitaddressing mode, bits 33-51 of general register R2 designate a 4K byteblock in real or absolute storage, and bits 0-32 and 52-63 of theregister are ignored. In the 64-bit addressing mode, bits 0-51 ofgeneral register R2 designate a 4K byte block in real or absolutestorage, and bits 52-63 of the register are ignored. Because it is areal or absolute address, the address designating the storage block isnot subject to dynamic address translation. The reference to the storagekey is not subject to a protection exception.

The new seven bit storage key value, or selected bits thereof, isobtained from bit positions 56-62 of general register R1. The contentsof bit positions 0-55 and 63 of the register are ignored. When theconditional SSKE facility is installed, and either or both the MR and MCbits are one, bit position 63 should contain a zero; otherwise, theprogram may not operate compatibly in the future.

A serialization and checkpoint synchronization function is performedbefore the operation begins and again after the operation is completed,except that when the conditional SSKE facility is installed and theresulting condition code is 0, it is unpredictable whether aserialization and checkpoint synchronization function is performed afterthe operation completes. For any store access, by any CPU or channelprogram, completed to the designated 4K byte block either before orafter the setting of the key by this instruction, the associated settingof the reference and change bits to one in the storage key for the blockalso is completed before or after, respectively, the execution of thisinstruction.

Setting Storage Keys in Multiple 4K Byte Blocks

When the enhanced DAT facility is not installed, or when the facility isinstalled, but the multiple block control is zero, the storage key for asingle 4K byte block is set, as described above. When the enhanced DATfacility is installed, and the multiple block control is one, thestorage keys for multiple 4K byte blocks within a 1 Megabyte block maybe set, beginning with the block specified by the second operandaddress, and continuing to the right with each successive block up tothe next 1 Megabyte boundary. In this case, SET STORAGE KEY EXTENDED isinterruptible, and processing is as follows:

When an interruption occurs (other than one that follows termination),general register R2 has been updated so the instruction, whenre-executed, resumes at the point of interruption. If either or both theMR or MC bits are one, the condition code is unpredictable; otherwise,the condition code is unchanged.

When the instruction completes without interruption, general register R2has been updated to the next 1 Megabyte boundary. If either or both theMR or MC bits are one, condition code 3 is set; otherwise, the conditioncode is unchanged.

In either of the above two cases, when either or both the MR or MC bitsare one, bits 48-55 of general register R1 are unpredictable.

When multiple block processing occurs and the R1 and R2 fields designatethe same register, the second operand address is placed in the register.When multiple block processing occurs in the 24-bit or 31-bit addressingmodes, the leftmost bits which are not part of the address in bitpositions 32-63 of general register R2 are set to zeros; bits 0-31 ofthe register are unchanged.

Resulting Condition Code:

When the conditional SSKE facility is not installed, or when both the MRand MC bits of the M3 field are zero, the condition code remainsunchanged. When the conditional SSKE facility is installed, and eitheror both of the MR and MC bits are one, the condition code is set asfollows:

0—Storage key not set

1—Entire storage key set

2—Partial storage key set

3—Entire storage key set; bits 48-55 of general register R1 areunpredictable.

Program Exceptions:

Addressing (address specified by general register R2)

Privileged operation

Change Recording

Change recording provides information as to which pages have to be savedin auxiliary storage when they are replaced in main storage. Changerecording uses the change bit, (bit 6), of the storage key. The changebit is set to one each time a store access causes the contents of thecorresponding storage block to be changed, and either (a) enhanced DATdoes not apply, or (b) enhanced DAT applies, and either of the followingis true:

The STE format control in the segment table entry used by DAT is zero,and the change recording override (CO) in the page table entry used byDAT is zero.

The STE format control in the segment table entry used by DAT is one,and the change recording override (CO) in the segment table entry usedby DAT is zero.

A store access that does not change the contents of storage may or maynot set the change bit to one. The change bit is not set to one for anattempt to store if the access is prohibited. In particular:

For the CPU, a store access is prohibited whenever an access exceptionexists for that access, or whenever an exception exists which is ofhigher priority than the priority of an access exception for thataccess.

For the channel subsystem, a store access is prohibited whenever a keycontrolled protection violation exists for that access.

Change recording is always active and takes place for all store accessesto storage, including those made by any CPU (except when suppressed bythe change recording override, described herein), any operator facility,or the channel subsystem. It takes place for implicit references made bythe machine, such as those which are part of interruptions.

Change recording does not take place for the operands of the followinginstructions since they directly modify a storage key without modifyinga storage location:

RESET REFERENCE BIT EXTENDED

SET STORAGE KEY EXTENDED (change bit is set to a specified value).

Change bits which have been changed from zeros to ones are notnecessarily restored to zeros on CPU retry.

Change Recording Override (CO)

The storage key's change bit is set to one each time a store accesscauses the contents of the corresponding storage block to be changed. Astore access that does not change the contents of storage may or may notset the change bit to one. The change bit is not set to one on anattempt to store if the access is prohibited. Change recording overrideallows the setting of the storage key's change bit to be bypassed.

When enhanced DAT applies, and the virtual address is translated bymeans of DAT table entries, a change recording override (CO) is providedin bit 55 of both the segment table entry and the page table entry. Whenthe STE format control (FC) bit 53 of the segment table entry is zero,the change recording override in the page table entry applies. When thechange recording override in the PTE is zero, change recording occursfor store operations to the 4K byte block. When the change recordingoverride is one, it is unpredictable whether change recording occurs forstore operations to the 4K byte block. When the STE format control isone, the change recording override in the STE applies. When the changerecording override in the STE is zero, change recording occurs for storeoperations to any of the segment's 256 4K byte blocks. When the changerecording override in the STE is one, it is unpredictable whether changerecording occurs to any of the segment's 256 4K byte blocks.

The change recording override does not apply to real or absoluteaddresses, or to a virtual address that is translated by means of a realspace designation.

Reference is now being made to FIG. 12 illustrating a flow diagram ofone embodiment of obtaining the change recording override field from thesegment table entry used in dynamic address translation of a virtualaddress.

Dynamic address translation proceeds to the point wherein a segmenttable entry has been fetched from a segment table used in translation asdescribed in FIG. 6 to node 616. Address translation continues asdescribed in FIG. 8 to node 822 wherein an absolute address to a desiredblock of data in storage or memory has been obtained. The flow of FIG.12 begins at node 822.

At 1210, a change recording override (CO) field is obtained from thesegment table entry used in translation. Change recording overrideenables the storage key's change bit to be overridden. At 1212, adetermination is made whether access performed on the desired block ofdata addressed by the translated virtual address is a store-type or afetch-type operation. If the access is a fetch-type access then, at1213, the setting of the change bit does not occur and change recordingoverride does not apply. If the access was a store-type operation then,at 1214, a determination is made as to whether the change recordingoverride in the segment table entry is enabled. If, at 1214, changerecording override is not enabled then, at 1218, the change bit of thestorage key associated with the desired block is set to 1. If, at 1214,change recording override is enabled then, at 1216, the change bit ofthe associated storage key is not set. At 1220, an indication is madethat the desired block of data has been modified.

In another embodiment, if enhanced DAT applies and the format control inthe STE is not enabled, an origin of a page table is obtained from thesegment table entry. A page index portion of the virtual address is usedto reference a page table entry in the page table. A page-frame realaddress of a small block of data in main storage and a page changeoverride field are obtained from the page table entry. Each small blockof data has an associated storage key containing a change bit. The smallblock of data is smaller in size than the large block of data andconsists of a 4 Kilobyte (4096 bytes) block of data. A translatedaddress of a desired real block of data in main storage contains acombination of the page-frame real address and the byte-index portion ofthe virtual. A determination is made whether a store or a fetch-typeoperation was performed to the desired real block of data. If the accessoperation was a fetch-type operation then change recording override doesnot apply. If the access was a store-type operation, then if the changerecording override field associated with the virtual address is disabledthen the change bit of the storage key associated with the desired 4Kblock is set to 1. An indication is provided that the desired 4K blockhas been modified.

In another embodiment, if the change recording override field isenabled, the change bit of the storage key associated with the desired4K block is unpredictable.

Commercial Implementation

Although the z/Architecture by IBM® is mentioned herein, one or moreaspects of the present invention are equally applicable to other machinearchitectures and/or computing environments employing pageable entitiesor similar constructs.

Commercial implementations of the eDAT facility and other formats,instructions, and attributes disclosed herein can be implemented eitherin hardware or by programmers, such as operating system programmers,writing in, for example, assembly language. Such programminginstructions may be stored on a storage medium intended to be executednatively in a computing environment such as the IBM® System z server, oralternatively in machines executing other architectures. Theinstructions can be emulated in existing and in future IBM® servers andon other machines or mainframes. They can be executed in machines wheregenerally execution is in an emulation mode.

One or more aspects of the present invention are equally applicable to,for instance, virtual machine emulation, in which one or more pageableentities (e.g., guests) execute on one or more processors. As oneexample, pageable guests are defined by the Start Interpretive Execution(SIE) architecture described in “IBM® System/370 Extended Architecture”,IBM® Pub. No. SA22-7095 (1985), which is incorporated herein byreference in its entirety.

In emulation mode, the specific instruction being emulated is decoded,and a subroutine is executed to implement the individual instruction, asin a subroutine or driver, or some other technique is used for providinga driver for the specific hardware, as is within the skill of those inthe art after understanding the description hereof. Various software andhardware emulation techniques are described in numerous United Statespatents including: U.S. Pat. No. 5,551,013, U.S. Pat. No. 5,574,873,U.S. Pat. No. 5,790,825, U.S. Pat. No. 6,009,261, U.S. Pat. No.6,308,255, and U.S. Pat. No. 6,463,582, each of which is incorporatedherein by reference. Many other teachings further illustrate a varietyof ways to achieve emulation of an instruction set architected for atarget machine.

Other Variations and Architectures

The various embodiments described herein are just examples. There may bemany variations to these embodiments without departing from the spiritof the present invention.

One or more of the capabilities of the present invention can beimplemented in software, firmware, hardware, or some combinationthereof. Aspects of the invention are beneficial to many types ofenvironments, including other environments that have a plurality ofzones, and non-partitioned environments. Further, there may be nocentral processor complexes, but yet, multiple processors coupledtogether. Various aspects hereof are applicable to single processorenvironments.

Although particular environments are described herein, again, manyvariations to these environments can be implemented without departingfrom the spirit of the present invention. For example, if theenvironment is logically partitioned, then more or fewer logicalpartitions may be included in the environment. Further, there may bemultiple central processing complexes coupled together. These are onlysome of the variations that can be made without departing from thespirit of the present invention. Additionally, other variations arepossible.

Although the term ‘page’ is used to refer to a fixed size or apredefined size area of storage, the size of a page can vary. Similarly,the size of a block can vary. There may be different sizes of blocksand/or pages. A page may be equivalent to a block. Other structures maybe alternatively used or otherwise implemented through software and/orhardware. Further, in the examples described herein, there may be manyvariations, including, but not limited to different sized words oraddresses; a different number of bits; bits in a different order; more,fewer or different bits; more, fewer or different fields; fields in adiffering order; different sizes of fields; etc. Again, these are onlyprovided as an example. Many variations are possible.

A processing unit includes pageable entities, such as guests, hosts,other processors, emulators, virtual machines, and/or other similarconstructs. A buffer includes an area of storage and/or memory as wellas different types of data structures including, but not limited to,arrays or pageable entities. A table can include other data structuresas well. An instruction can reference other registers. Moreover, a page,a segment, and/or a region can be of varying sizes different than thosedescribed herein.

One or more aspects of the present invention can be included in anarticle of manufacture (e.g., one or more computer program products)having, for instance, computer usable or machine readable media. Themedia has embodied therein, for instance, computer readable program codemeans or logic (e.g., instructions, code, commands, etc.) to provide andfacilitate the capabilities of the present invention. The article ofmanufacture can be included as a part of a computer system or soldseparately. Additionally, at least one program storage device readableby a machine embodying at least one program of instructions executableby the machine to perform the capabilities of the present invention canbe provided.

The flow diagrams depicted herein are illustrative. There may be manyvariations to these diagrams or the steps or operations describedwithout departing from the spirit of the invention. For instance, thesteps may be performed in a differing order, or steps may be added,deleted or modified. All of these variations are considered a part ofthe invention as claimed.

Although embodiments hereof have been depicted and described in detailherein, it will be apparent to those skilled in the relevant art thatvarious modifications, additions, substitutions and the like can be madewithout departing from the spirit of the invention and these aretherefore considered to be within the scope of the invention as definedin the following claims.

What we claim is:
 1. A method for protecting data in a computer systemhaving a hierarchy of translation tables used for translation of avirtual address into a translated address of a block of main storage,the method comprising: building a software routine to emulate executionof an instruction of a first computer architecture on a general purposeprocessor of an alternate computer architecture, the instructionconfigured to protect data, the software routine comprising a pluralityof instructions, the software routine configured to cause the generalpurpose processor of the alternate computer architecture to perform amethod comprising obtaining for translation a virtual address of adesired block of main storage; obtaining an initial origin of atranslation table in a hierarchy of translation tables, said hierarchyof translation tables comprising a segment table; based on said obtainedinitial origin address and said virtual address, obtaining a segmenttable entry from said segment table, said segment table entry configuredto contain a format control field; based on an enhanced dynamic addresstranslation (eDAT) facility being enabled, determining, by a processor,whether said format control field in said segment table entry isenabled; and based on said format control field being enabled,performing: determining whether an access validity field in said segmenttable entry is enabled, said segment table entry comprising said accessvalidity field, a segment access control field, a segment fetchprotection field and a segment-frame absolute address of a large blockof main storage, said large block of main storage comprising saiddesired block of main storage; and based on said access validity fieldbeing enabled, performing: permitting stores to said desired block ofstorage, wherein the stores are associated with the virtual address,said stores permitted in response to said segment access control fieldmatching a program access key provided by any one of a Program StatusWord or an operand of a program instruction being executed, wherein thestores are associated with the virtual address; and not permittingstores to said desired block of main storage based on said segmentaccess control filed not matching said program access key, wherein thestores are associated with the virtual address.
 2. The method accordingto claim 1, wherein said translated address is any one of a real addressor absolute address, wherein the real address is subject to prefixing toform the absolute address, wherein said hierarchy of translation tablesconsist of one or more of a region first table, a region second table, aregion third table and said segment table, wherein obtaining saidsegment table entry from said segment table comprises any one of A, B,C, D: A) based on said obtained initial origin address of said regionfirst table, using a first index portion of said virtual address toreference a region first table entry in said region first tablecontaining an origin address of said region second table; based on saidorigin address of said region second table, using a second index portionof said virtual address to reference a region second table entry in saidregion second table containing an origin address of said region thirdtable; based on said origin address of said region third table, using athird index portion of said virtual address to reference a region thirdtable entry in said region third table containing an origin address ofsaid segment table; and based on said origin address of said segmenttable, using a segment index portion of said virtual address toreference a segment table entry in said segment table; B) based on saidobtained initial origin address of said region second table, using thesecond index portion of said virtual address to reference said regionsecond table entry in said region second table containing an originaddress of said region third table; based on said origin address of saidregion third table, using said third index portion of said virtualaddress to reference said region third table entry in said region thirdtable containing the origin address of said segment table; and based onsaid origin address of said segment table, using said segment indexportion of said virtual address to reference said segment table entry insaid segment table; C) based on said obtained initial origin address ofsaid region third table, using said third index portion of said virtualaddress to reference said region third table entry in said region thirdtable containing the origin address of said segment table; and based onsaid origin address of said segment table, using said segment indexportion of said virtual address to reference said segment table entry insaid segment table; and D) based on the obtained initial origin addressof said segment table, using said segment index portion of said virtualaddress to reference said segment table entry.
 3. The method accordingto claim 2, wherein based on said eDAT facility being enabled and saidformat control field being not enabled, performing: obtaining from saidsegment table entry an origin of a page table and using a page indexportion of said virtual address to reference a page table entry in saidpage table; obtaining from said page table entry, a page-frame realaddress of a small block of main storage, said small block of mainstorage being smaller in size than said large block of main storage andconsisting of a 4 Kilobyte block of memory, said small block of mainstorage associated with a storage key comprising an storage accesscontrol field and a storage fetch protection field, wherein a translatedaddress of a desired real block of main storage comprises a combinationof said page-frame real address and a byte-index portion of said virtualaddress; only permitting stores to said desired real block of storage,wherein the stores are associated with the virtual address, based onsaid program access key matching said storage access control field, saidprogram access key being provided by a program entity comprising any oneof a Program Status Word or an operand of said instruction of a firstcomputer architecture; and only permitting fetches from said desiredblock of main storage wherein the fetches are associated with thevirtual address based on either a) the storage fetch protection fieldbeing disabled, or b) both the storage fetch protection field beingenabled and a program access key being equal to said storage accesscontrol field, said program access key being provided by any one of aProgram Status Word or an operand of said instruction of a firstcomputer architecture.
 4. The method according to claim 2, wherein basedon said eDAT facility being not enabled, performing: obtaining from saidsegment table entry an origin of a page table and using a page indexportion of said virtual address to reference a page table entry in saidpage table; obtaining from said page table entry, a page-frame realaddress of a small block of main storage, said small block of mainstorage being smaller in size than said large block of main storage andconsisting of a 4 Kilobyte block of main storage associated with astorage key, the storage key comprising a storage access control fieldand a storage fetch protection field, wherein a translated address of adesired real block of main storage comprises a combination of saidpage-frame real address and a byte-index portion of said virtualaddress; only permitting stores to said desired real block of storagewherein the stores are associated with the virtual address based on saidaccess key matching said storage access control field; and onlypermitting fetches from said desired block of main storage wherein thefetches are associated with the virtual address based on either a) thestorage fetch protection field being disabled, or b) both the storagefetch protection field being enabled and a program access key associatedwith the virtual address being equal to said storage access controlfield, said program access key being provided by any one of a ProgramStatus Word or an operand of said instruction of a first computerarchitecture.
 5. The method according to claim 1, wherein based on saidprogram access key being zero, permitting stores to said desired blockof storage and fetches from said desired block of storage, wherein thestores and fetches are associated with the virtual address.
 6. Themethod according to claim 1, wherein based on said access validity fieldand said segment fetch protection field being enabled, indicating aprotection exception based on a fetch operation being attempted fromsaid desired block of main storage and said segment access control fieldnot matching said program access key, said fetch operation beingassociated with said virtual address.
 7. The method according to claim1, wherein determining whether said access validity field is enabledfurther comprises determining any one of a) whether aStorage-Protection-Override field of a control register is disabled andb) whether said Storage-Protection-Override field is enabled and saidsegment access control field differs from a predefined value.
 8. Themethod according to claim 1, further comprising: storing informationused in said translation of said virtual address in at least onetranslation lookaside buffer; and performing a subsequent translation ofa subsequent virtual address into said absolute address of said block ofmain storage main storage using said stored information from saidtranslation lookaside buffer rather than said hierarchy of translationtables.
 9. The method according to claim 1, wherein responsive to saidvirtual address to be translated being not native to a machinearchitecture, further comprising: identifying a predetermined softwareroutine for emulating said translation, said predetermined softwareroutine comprising a plurality of instructions; and executing saidpredetermined software routine.
 10. The method according to claim 9,wherein independent of said format control field being enabled or notenabled, said segment table entry further comprises a DAT protection bit(P) for controlling whether store operations are permitted, a segmentinvalid bit (I) for indicating whether a segment table entry can be usedfor translation, and a common segment bit (C) for controlling the use oftranslation lookaside buffer copies of the segment table entry.
 11. Themethod according to claim 1, wherein said large block of main storagecomprises a block of at least 1 Megabyte in size.
 12. The methodaccording to claim 1, wherein independent of said format control fieldbeing enabled or not enabled, said segment table entry further comprisesa DAT protection bit (P) for controlling whether store operations arepermitted, a segment invalid bit (I) for indicating whether a segmenttable entry can be used for translation, and a common segment bit (C)for controlling the use of translation lookaside buffer copies of thesegment table entry.